Compare commits

..

18 Commits
1.0 ... master

Author SHA1 Message Date
7f2e7a8caf Merging 2018-01-28 20:50:56 -07:00
65b8d67832 Improve coverage 2018-01-28 20:44:08 -07:00
02bba5be19 Update readme 2018-01-28 18:17:46 -07:00
557a7956b2 Improve script, make BS4 CSS 2018-01-28 18:15:24 -07:00
a21a5ffb2f Add generation script 2018-01-28 00:06:27 -07:00
0817678127 Color tweak 2018-01-27 23:26:42 -07:00
206232ba39 Add minification script 2017-11-07 13:55:12 -07:00
639192478e Add minification script 2017-11-07 13:43:22 -07:00
8c98f168a7 Update text colors to more closely match original palette, Add -blacktext classes for navbar colors where 600 is white and 500 is black 2017-11-07 13:42:58 -07:00
ae03686b60 Use a bunch of regex magic to add CSS variables 2017-07-23 23:53:22 -06:00
ee21ff9ec8 Change license to Markdown, set copyright year and holder 2017-07-23 20:41:44 -06:00
5e464c5ae7 Update 'README.md' 2017-07-23 20:40:14 -06:00
f3bfb10154 Update 'README.md' 2017-05-15 11:17:49 -06:00
f0011221dc Fix navbar border 2017-05-14 22:23:34 -06:00
0a7753c1bf Fix navbar border 2017-05-14 22:22:41 -06:00
928139a345 Update 'README.md' 2017-05-14 22:09:33 -06:00
250ad30a1a Make navbars and buttons work better 2017-05-14 22:06:13 -06:00
726fd2ca25 Make navbars and buttons work better 2017-05-14 22:04:03 -06:00
6 changed files with 638 additions and 641 deletions

View File

@ -1,5 +1,5 @@
MIT License # MIT License
Copyright (c) <year> <copyright holders> Copyright (c) 2017 Netsyms Technologies
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

View File

@ -1,3 +1,9 @@
# Material-Color # Material-Color
Additional color classes for Bootstrap 3. Based on the [Material Design palette](https://material.io/guidelines/style/color.html#color-color-palette). Additional color classes for Bootstrap 4. Based on the [Material Design palette](https://material.io/guidelines/style/color.html#color-color-palette).
## Notes:
* Link this CSS after you link to Bootstrap.css.
* Use the included color classes instead of .btn-primary, .alert-danger, etc.
* Navbars need .navbar-dark or .navbar-light to appear properly, choose according to your colors.
* We recommend using [Bootswatch Materia](https://bootswatch.com/materia/) (a material design Bootstrap theme) with this stylesheet.

136
generate.php Normal file
View File

@ -0,0 +1,136 @@
<?php
$use_variables = false;
$classes = [
"alert" => ["background-color" => "m", "color" => "t!"],
"alert .alert-link" => ["color" => "t!"],
"alert .alert-heading" => ["color" => "t!"],
"badge" => ["background-color" => "m", "color" => "t"],
"btn" => ["background-color" => "m", "color" => "t"],
"bg" => ["background-color" => "m"],
"list-group-item" => ["background-color" => "m", "color" => "t"],
"border" => ["border-color" => "m", "border-width" => "1px"],
"text" => ["color" => "m"]
];
$colors = [
"red" => "#f44336",
"pink" => "#e91e63",
"purple" => "#9c27b0",
"deep-purple" => "#673ab7",
"indigo" => "#3f51b5",
"blue" => "#2196f3",
"light-blue" => "#03a9f4",
"cyan" => "#00bcd4",
"teal" => "#009688",
"green" => "#4caf50",
"light-green" => "#8bc34a",
"lime" => "#cddc39",
"yellow" => "#ffeb3b",
"amber" => "#ffc107",
"orange" => "#ff9800",
"deep-orange" => "#ff5722",
"brown" => "#795548",
"grey" => "#9e9e9e",
"blue-grey" => "#607d8b"
];
$texts = [
"red" => "white",
"pink" => "white",
"purple" => "white",
"deep-purple" => "white",
"indigo" => "white",
"blue" => "white",
"light-blue" => "black",
"cyan" => "black",
"teal" => "white",
"green" => "white",
"light-green" => "black",
"lime" => "black",
"yellow" => "black",
"amber" => "black",
"orange" => "black",
"deep-orange" => "white",
"brown" => "white",
"grey" => "black",
"blue-grey" => "white"
];
/* License header */
$year = date('Y');
echo <<<END
/* Material-Color.css
* Copyright (c) $year Netsyms Technologies
* MIT License
* https://source.netsyms.com/Netsyms/Material-Color
*/
END;
/* Make CSS variables */
if ($use_variables) {
echo ":root {\n";
foreach ($colors as $k => $v) {
if (strpos($k, "text-") !== FALSE) {
continue;
}
echo "\t--material-color-$k: $v;\n";
}
echo "}\n\n";
}
/* The fun bit */
foreach ($classes as $c => $props) {
foreach ($colors as $k => $v) {
$t = $texts[$k];
// Save a few bytes
if ($t == "white") {
$t = "#fff";
} else if ($t == "black") {
$t = "#000";
}
// Color setup
if ($use_variables) {
$m = "var(--material-color-$k)";
} else {
$m = $v;
}
// Class
if (strpos($c, " ") !== FALSE) {
$classes = explode(" ", $c);
foreach ($classes as $cl) {
if (strpos($cl, ".") === 0) {
echo "$cl ";
} else {
echo ".$cl-$k ";
}
}
echo "{\n";
} else {
echo ".$c-$k {\n";
}
foreach ($props as $prop => $val) {
echo "\t$prop: ";
if (strpos($val, "m") === 0) {
echo $m;
} else if (strpos($val, "t") === 0) {
echo $t;
} else {
echo $val;
}
if (strpos($val, "!") === 1) {
echo " !important";
}
echo ";\n";
}
// Finish it off
echo "}\n";
}
}
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

6
minify.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
command -v yui-compressor >/dev/null 2>&1 || { echo >&2 "Please install yui-compressor and try again."; exit 1; }
echo "Compressing CSS..."
echo "$(head -n 5 material-color.css)" > material-color.min.css
echo "$(yui-compressor material-color.css)" >> material-color.min.css
echo "Done."