design: custom build of bulma

This commit is contained in:
Sam Rijs 2018-01-29 18:34:22 +11:00
parent ab48353ce8
commit 8f5f1b4542
8 changed files with 55 additions and 3 deletions

3
.gitmodules vendored Normal file
View file

@ -0,0 +1,3 @@
[submodule "assets/styles/bulma"]
path = assets/styles/bulma
url = https://github.com/jgthms/bulma

View file

@ -20,3 +20,6 @@ slog-json = "2.2.0"
tokio-core = "0.1.12" tokio-core = "0.1.12"
tokio-service = "0.1.0" tokio-service = "0.1.0"
toml = "0.4.5" toml = "0.4.5"
[build-dependencies]
sass-rs = "0.2.1"

View file

@ -1,2 +0,0 @@
@import url('https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
@import url('https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.2/css/bulma.min.css');

1
assets/styles/bulma Submodule

@ -0,0 +1 @@
Subproject commit 6078acdd92f250d1c5ab3c512468e228c1b45630

19
assets/styles/main.sass Normal file
View file

@ -0,0 +1,19 @@
@charset "utf-8";
@import "utilities/initial-variables";
@import "utilities/functions";
// make view narrower
$widescreen: $desktop;
$fullhd: $desktop;
// custom fonts
$family-sans-serif: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
$family-monospace: "Source Serif Pro", monospace;
@import "utilities/_all";
@import "base/_all";
@import "elements/_all";
@import "components/_all";
@import "grid/_all";
@import "layout/_all";

25
build.rs Normal file
View file

@ -0,0 +1,25 @@
extern crate sass_rs as sass;
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::Path;
fn build_style() -> String {
let options = sass::Options {
output_style: sass::OutputStyle::Compressed,
include_paths: vec!["./assets/styles/bulma/sass/".to_string()],
..Default::default()
};
sass::compile_file("./assets/styles/main.sass", options)
.expect("failed to compile style sheet")
}
fn main() {
let out_dir = env::var("OUT_DIR").unwrap();
let dest_path = Path::new(&out_dir).join("style.css");
let mut f = File::create(&dest_path).unwrap();
f.write_all(build_style().as_bytes()).unwrap();
}

View file

@ -6,4 +6,4 @@ pub static BADGE_OUTDATED_SVG: &'static [u8; 974] =
include_bytes!("../../assets/badges/outdated.svg"); include_bytes!("../../assets/badges/outdated.svg");
pub static STATIC_STYLE_CSS: &'static str = pub static STATIC_STYLE_CSS: &'static str =
include_str!("../../assets/static/style.css"); include_str!(concat!(env!("OUT_DIR"), "/style.css"));

View file

@ -89,6 +89,9 @@ pub fn status_html(analysis_outcome: AnalyzeDependenciesOutcome, repo_path: Repo
meta name="viewport" content="width=device-width, initial-scale=1"; meta name="viewport" content="width=device-width, initial-scale=1";
title (title) title (title)
link rel="stylesheet" type="text/css" href="/static/style.css"; link rel="stylesheet" type="text/css" href="/static/style.css";
link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Fira+Sans:400,500,600";
link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Source+Code+Pro";
link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css";
} }
body { body {
section class=(format!("hero {}", hero_class)) { section class=(format!("hero {}", hero_class)) {