Browse Source

Add generation script

bootstrap-4
Skylar Ittner 4 years ago
parent
commit
a21a5ffb2f
  1. 64
      generate.php

64
generate.php

@ -0,0 +1,64 @@
<?php
$classes = ["alert", "badge", "btn", "bg", "list-group-item"];
$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"
];
echo ":root {\n";
foreach ($colors as $k => $v) {
if (strpos($k, "text-") !== FALSE) {
continue;
}
echo "\t--material-color-$k: $v;\n";
}
echo "}\n\n";
foreach ($classes as $c) {
foreach ($colors as $k => $v) {
$textcolor = $texts[$k];
echo ".$c-$k {\n\tbackground-color: var(--material-color-$k);\n\tcolor: $textcolor;\n}\n";
}
}
?>
Loading…
Cancel
Save