Skip to content

Commit 5494102

Browse files
committed
Grayscale variables for css and less
1 parent 933d710 commit 5494102

File tree

5 files changed

+66
-20
lines changed

5 files changed

+66
-20
lines changed

spec/spec-css.html

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,37 @@ <h5>Section Nanoheader (h4)</h5>
6262
<figcaption>Figure Link</figcaption>
6363
</figure>
6464
</a>
65-
Icon figures:
65+
<br>
66+
<p>
67+
Checkerboard:&nbsp;
68+
<img src=https://centerkey.com/graphics/center-key-logo.svg
69+
class=checkerboard-box alt=logo>
70+
&nbsp;
71+
<img src=https://centerkey.com/graphics/center-key-logo.svg
72+
style="background: var(--checkerboardBackground);" alt=logo>
73+
</p>
74+
<div>
75+
Icon figures:
6676
<figure><i data-icon=rocket></i></figure>
6777
<figure><span>🚀</span></figure>
78+
</div>
79+
<div>
80+
Grays (<code>--colorGray0</code> to <code>--colorGray9</code>):
81+
<figure style="display: flex; font-size: 3rem; color: black; border: 10px solid black; margin-bottom: 20px;">
82+
<div style="background-color: var(--colorWhite); flex: 1;">W</div>
83+
<div style="background-color: var(--colorGray0); flex: 1;">0</div>
84+
<div style="background-color: var(--colorGray1); flex: 1;">1</div>
85+
<div style="background-color: var(--colorGray2); flex: 1;">2</div>
86+
<div style="background-color: var(--colorGray3); flex: 1;">3</div>
87+
<div style="background-color: var(--colorGray4); flex: 1;">4</div>
88+
<div style="background-color: var(--colorGray5); flex: 1;">5</div>
89+
<div style="background-color: var(--colorGray6); flex: 1;">6</div>
90+
<div style="background-color: var(--colorGray7); flex: 1;">7</div>
91+
<div style="background-color: var(--colorGray8); flex: 1;">8</div>
92+
<div style="background-color: var(--colorGray9); flex: 1;">9</div>
93+
<div style="background-color: var(--colorBlack); flex: 1; color: white;">B</div>
94+
</figure>
95+
</div>
6896
<h3>Header 3 &mdash; Ant</h3>
6997
<aside>
7098
<h2>H2 on the Side</h2>

src/css/reset.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
--colorGraphite: #303030;
1414
--colorCharcoal: #222222;
1515
--colorTar: #161616;
16+
--colorWhite: #FFFFFF;
17+
--colorGray0: #EEEEEE;
18+
--colorGray1: #DDDDDD;
19+
--colorGray2: #BBBBBB;
20+
--colorGray3: #AAAAAA;
21+
--colorGray4: #888888;
22+
--colorGray5: #777777;
23+
--colorGray6: #555555;
24+
--colorGray7: #444444;
25+
--colorGray8: #222222;
26+
--colorGray9: #111111;
27+
--colorBlack: #000000;
1628
}
1729

1830
// Reset and Normalization

src/css/reset/figures.less

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66
// <img src=buffalo.jpg alt=buffalo>
77
// <figcaption>buffalo</figcaption>
88
// </figure>
9+
:root {
10+
--checkerboardBackground: conic-gradient(
11+
lightgray 90deg,
12+
darkgray 90deg 180deg,
13+
lightgray 180deg 270deg,
14+
darkgray 270deg)
15+
top left / 15px 15px;
16+
}
917
img {
1018
border: none;
1119
}

src/css/reset/static/utility-box.less

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010
@colorGraphite: #303030;
1111
@colorCharcoal: #222222;
1212
@colorTar: #161616;
13+
@colorWhite: #FFFFFF;
14+
@colorGray0: #EEEEEE;
15+
@colorGray1: #DDDDDD;
16+
@colorGray2: #BBBBBB;
17+
@colorGray3: #AAAAAA;
18+
@colorGray4: #888888;
19+
@colorGray5: #777777;
20+
@colorGray6: #555555;
21+
@colorGray7: #444444;
22+
@colorGray8: #222222;
23+
@colorGray9: #111111;
24+
@colorBlack: #000000;
1325

1426
// Layers for z-index
1527
@layerDialogBox: 500; //cream of the crop
@@ -51,26 +63,11 @@
5163
paint-order: stroke fill;
5264
}
5365

54-
.CheckerboardBackground() {
55-
// <figure class=checkerboard-background>
56-
// <img src=logo.svg alt=logo>
57-
// <figcaption>Logo</figcaption>
58-
// </figure>
66+
.CheckerboardBox() {
67+
background: var(--checkerboardBackground);
68+
outline: 3px solid black;
5969
&:hover {
60-
img {
61-
background: black;
62-
outline-width: 1px; //extra space for a clean image crop
63-
}
64-
}
65-
img {
66-
background: conic-gradient(
67-
lightgray 90deg,
68-
darkgray 90deg 180deg,
69-
lightgray 180deg 270deg,
70-
darkgray 270deg
71-
);
72-
background-size: 15px 15px;
73-
outline: 3px solid black;
70+
background: black;
7471
}
7572
}
7673

src/css/reset/utility-classes.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
.box-glow { box-shadow: 0px 0px 2em deepskyblue; }
3232
.centered-flow-box { display: flex; flex-wrap: wrap; justify-content: center; }
3333
.bullseye { display: flex; justify-content: center; align-items: center; }
34+
.checkerboard-box { .CheckerboardBox(); }
3435
.framed img, img.framed { background-color: white; border: 3px solid silver; border-radius: 2px; transition: all 500ms; }
3536
.framed img:hover, img.framed:hover { border-color: dimgray; }
3637
.modal-layer { display: none; position: fixed; top: 0px; left: 0px; width: 100%; height: 100vh; text-align: center; }

0 commit comments

Comments
 (0)