Skip to content

Commit

Permalink
Update MaterialZ and add dark theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ZMYaro committed May 3, 2021
1 parent ca46a96 commit 6ae402c
Show file tree
Hide file tree
Showing 6 changed files with 788 additions and 199 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<link rel="stylesheet" type="text/css" href="lib/material-elements.css" />
<link rel="stylesheet" type="text/css" href="lib/material-depth.css" />
<link rel="stylesheet" type="text/css" href="lib/material-widgets.css" />
<link rel="stylesheet" type="text/css" href="lib/material-dark.css" media="(prefers-color-scheme: dark)" />
<style type="text/css">
* {
box-sizing: border-box;
Expand Down
219 changes: 219 additions & 0 deletions lib/material-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
/* Base Material styles for dark theme
* Part of the MaterialZ CSS library
*
* Copyright 2015-2021 Zachary Yaro
* Released under the MIT license
* https://materialz.dev/LICENSE.txt
*/

@charset "UTF-8";

body {
background-color: #121212;
color: #ffffff;
}

/* --------======== BUTTONS and DROP-DOWNS ========-------- */
select {
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAIAgMAAADCRZTUAAAACVBMVEUAAAD///////9zeKVjAAAAAnRSTlMAgJsrThgAAAAySURBVAjXY8hatWolAwxIrVq1BM5hW7VqApzDuGqVAwMcZAG1IDQBtSA0AbUgNCG0AAD8iAqhtDTiaAAAAABJRU5ErkJggg==);
}
button:not(:disabled):hover,
button:focus,
[role="button"]:not(:disabled):hover,
[role="button"]:focus,
input[type="button"]:not(:disabled):hover,
input[type="button"]:focus,
input[type="submit"]:not(:disabled):hover,
input[type="submit"]:focus,
input[type="reset"]:not(:disabled):hover,
input[type="reset"]:focus,
select:not(:disabled):hover,
select:focus {
background-color: #313131;
background-color: rgba(128, 128, 128, 0.2);
}
/* The “active” class is used to force the appearance of the active/pressed state */
button:not(:disabled):active,
button:not(:disabled).active,
[role="button"]:not(:disabled):active,
[role="button"]:not(:disabled).active,
input[type="button"]:not(:disabled):active,
input[type="button"]:not(:disabled).active,
input[type="submit"]:not(:disabled):active,
input[type="submit"]:not(:disabled).active,
input[type="reset"]:not(:disabled):active,
input[type="reset"]:not(:disabled).active,
select:not(:disabled):active,
select:not(:disabled).active {
background-color: #444444;
background-color: rgba(128, 128, 128, 0.4);
}

/* --------======== RADIO BUTTONS AND CHECKBOXES ========-------- */
input[type="checkbox"]::after {
border-color: #1d1d1d;
}

/* --------======== TEXT FIELDS ========-------- */
input[type="text"],
input[type="search"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select[size] {
border-bottom-color: #c8c8c8;
}


/* --------======== LISTS ========-------- */
.list li {
border-color: #363636;
border-color: rgba(128, 128, 128, 0.25);
}

/* --------======== CARDS ========-------- */
.card,
.card.z1 {
background-color: #1d1d1d;
}
button.z1,
button.z2,
button.z3,
button.z4,
button.z5,
[role="button"].z1,
[role="button"].z2,
[role="button"].z3,
[role="button"].z4,
[role="button"].z5 ,
input[type="button"].z1,
input[type="button"].z2,
input[type="button"].z3,
input[type="button"].z4,
input[type="button"].z5,
input[type="submit"].z1,
input[type="submit"].z2,
input[type="submit"].z3,
input[type="submit"].z4,
input[type="submit"].z5,
input[type="reset"].z1,
input[type="reset"].z2,
input[type="reset"].z3,
input[type="reset"].z4,
input[type="reset"].z5 {
background-color: #212121;
}
.card.z2,
button.z1:hover,
button.z2:hover,
button.z3:hover,
button.z4:hover,
button.z5:hover,
[role="button"].z1:hover,
[role="button"].z2:hover,
[role="button"].z3:hover,
[role="button"].z4:hover,
[role="button"].z5:hover,
input[type="button"].z1:hover,
input[type="button"].z2:hover,
input[type="button"].z3:hover,
input[type="button"].z4:hover,
input[type="button"].z5:hover,
input[type="submit"].z1:hover,
input[type="submit"].z2:hover,
input[type="submit"].z3:hover,
input[type="submit"].z4:hover,
input[type="submit"].z5:hover,
input[type="reset"].z1:hover,
input[type="reset"].z2:hover,
input[type="reset"].z3:hover,
input[type="reset"].z4:hover,
input[type="reset"].z5:hover,
button.z1:focus,
button.z2:focus,
button.z3:focus,
button.z4:focus,
button.z5:focus,
[role="button"].z1:focus,
[role="button"].z2:focus,
[role="button"].z3:focus,
[role="button"].z4:focus,
[role="button"].z5:focus,
input[type="button"].z1:focus,
input[type="button"].z2:focus,
input[type="button"].z3:focus,
input[type="button"].z4:focus,
input[type="button"].z5:focus,
input[type="submit"].z1:focus,
input[type="submit"].z2:focus,
input[type="submit"].z3:focus,
input[type="submit"].z4:focus,
input[type="submit"].z5:focus,
input[type="reset"].z1:focus,
input[type="reset"].z2:focus,
input[type="reset"].z3:focus,
input[type="reset"].z4:focus,
input[type="reset"].z5:focus {
background-color: #272727;
}
.card.z3,
button.z1:not(:disabled):active,
button.z2:not(:disabled):active,
button.z3:not(:disabled):active,
button.z4:not(:disabled):active,
button.z5:not(:disabled):active,
[role="button"].z1:active,
[role="button"].z2:active,
[role="button"].z3:active,
[role="button"].z4:active,
[role="button"].z5:active,
input[type="button"].z1:not(:disabled):active,
input[type="button"].z2:not(:disabled):active,
input[type="button"].z3:not(:disabled):active,
input[type="button"].z4:not(:disabled):active,
input[type="button"].z5:not(:disabled):active,
input[type="submit"].z1:not(:disabled):active,
input[type="submit"].z2:not(:disabled):active,
input[type="submit"].z3:not(:disabled):active,
input[type="submit"].z4:not(:disabled):active,
input[type="submit"].z5:not(:disabled):active,
input[type="reset"].z1:not(:disabled):active,
input[type="reset"].z2:not(:disabled):active,
input[type="reset"].z3:not(:disabled):active,
input[type="reset"].z4:not(:disabled):active,
input[type="reset"].z5:not(:disabled):active,
button.z1:not(:disabled).active,
button.z2:not(:disabled).active,
button.z3:not(:disabled).active,
button.z4:not(:disabled).active,
button.z5:not(:disabled).active,
[role="button"].z1.active,
[role="button"].z2.active,
[role="button"].z3.active,
[role="button"].z4.active,
[role="button"].z5.active,
input[type="button"].z1:not(:disabled).active,
input[type="button"].z2:not(:disabled).active,
input[type="button"].z3:not(:disabled).active,
input[type="button"].z4:not(:disabled).active,
input[type="button"].z5:not(:disabled).active,
input[type="submit"].z1:not(:disabled).active,
input[type="submit"].z2:not(:disabled).active,
input[type="submit"].z3:not(:disabled).active,
input[type="submit"].z4:not(:disabled).active,
input[type="submit"].z5:not(:disabled).active,
input[type="reset"].z1:not(:disabled).active,
input[type="reset"].z2:not(:disabled).active,
input[type="reset"].z3:not(:disabled).active,
input[type="reset"].z4:not(:disabled).active,
input[type="reset"].z5:not(:disabled).active {
background-color: #2d2d2d;
}
.card.z4 {
background-color: #353535;
}
.card.z5 {
background-color: #373737;
}
37 changes: 27 additions & 10 deletions lib/material-depth.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* Base Material styles for depth
* Part of the MaterialZ CSS library
*
* Copyright 2015 Zachary Yaro
* Copyright 2015-2021 Zachary Yaro
* Released under the MIT license
* http://materialz.zmyaro.com/LICENSE.txt
* https://materialz.dev/LICENSE.txt
*/

@charset "UTF-8";
Expand All @@ -29,6 +29,17 @@
-o-transition-property: box-shadow;
transition-property: box-shadow;
}
.card.full-width.z1,
.card.full-width.z2,
.card.full-width.z3,
.card.full-width.z4,
.card.full-width.z5 {
-webkit-transition-property: margin, border-radius, -webkit-box-shadow, box-shadow;
-moz-transition-property: margin, border-radius, -moz-box-shadow, box-shadow;
-ms-transition-property: margin, border-radius, box-shadow;
-o-transition-property: margin, border-radius, box-shadow;
transition-property: margin, border-radius, box-shadow;
}
button.z1,
button.z2,
button.z3,
Expand Down Expand Up @@ -165,8 +176,6 @@ input[type="reset"].z5 {
-webkit-box-shadow: rgba(0, 0, 0, 0.26) 0 2px 5px 0, rgba(0, 0, 0, 0.16) 0 2px 10px 0;
-moz-box-shadow: rgba(0, 0, 0, 0.26) 0 2px 5px 0, rgba(0, 0, 0, 0.16) 0 2px 10px 0;
box-shadow: rgba(0, 0, 0, 0.26) 0 2px 5px 0, rgba(0, 0, 0, 0.16) 0 2px 10px 0;
filter: progid:DXImageTransform.Microsoft.Glow(Color=#b8b8b8,Strength=5);
-ms-filter: "progid:DXImageTransform.Microsoft.Glow(Color=#b8b8b8,Strength=5)";
}

button.z1:hover,
Expand All @@ -182,8 +191,6 @@ input[type="reset"].z1:focus {
-webkit-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.23), 0 4px 15px 0 rgba(0, 0, 0, 0.175);
-moz-box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.23), 0 4px 15px 0 rgba(0, 0, 0, 0.175);
box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.23), 0 4px 15px 0 rgba(0, 0, 0, 0.175);
filter: progid:DXImageTransform.Microsoft.Glow(Color=#b4b4b4,Strength=7);
-ms-filter: "progid:DXImageTransform.Microsoft.Glow(Color=#b4b4b4,Strength=7)";
}
.z2,
button.z1:enabled:active,
Expand All @@ -199,8 +206,6 @@ input[type="reset"].z1.active {
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 8px 17px 0, rgba(0, 0, 0, 0.19) 0 6px 20px 0;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0 8px 17px 0, rgba(0, 0, 0, 0.19) 0 6px 20px 0;
box-shadow: rgba(0, 0, 0, 0.2) 0 8px 17px 0, rgba(0, 0, 0, 0.19) 0 6px 20px 0;
filter: progid:DXImageTransform.Microsoft.Glow(Color=#b0b0b0,Strength=10);
-ms-filter: "progid:DXImageTransform.Microsoft.Glow(Color=#b0b0b0,Strength=10)";
}
.z3,
button.z2:enabled:active,
Expand Down Expand Up @@ -255,6 +260,18 @@ input[type="reset"].z1.disabled {
-webkit-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 2px 0, rgba(0, 0, 0, 0.14) 0 2px 5px 0;
-moz-box-shadow: rgba(0, 0, 0, 0.2) 0 2px 2px 0, rgba(0, 0, 0, 0.14) 0 2px 5px 0;
box-shadow: rgba(0, 0, 0, 0.2) 0 2px 2px 0, rgba(0, 0, 0, 0.14) 0 2px 5px 0;
filter: progid:DXImageTransform.Microsoft.Glow(Color=#b8b8b8,Strength=5);
-ms-filter: "progid:DXImageTransform.Microsoft.Glow(Color=#b8b8b8,Strength=5)";
}

@media (prefers-reduced-motion: reduce) {
.z1,
.z2,
.z3,
.z4,
.z5 {
-webkit-transition-duration: 0s;
-moz-transition-duration: 0s;
-ms-transition-duration: 0s;
-o-transition-duration: 0s;
transition-duration: 0s;
}
}
Loading

0 comments on commit 6ae402c

Please sign in to comment.