Skip to content

Commit 86458bf

Browse files
committed
css system updated
1 parent cb5d1c5 commit 86458bf

13 files changed

+847
-455
lines changed

css/base.scss

+15-34
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,7 @@ $u-font-sans-serif: arial, ui-sans-serif, sans-serif;
5959
:root {
6060
--color: #{$u-text};
6161
--back: #{$u-background};
62-
6362
--focus: #{hsl($u-hue, 50%, 50%)};
64-
--code: rgb(255 255 185);
65-
6663
--text-spacing: #{$u-text-spacing};
6764

6865
color-scheme: dark light;
@@ -133,7 +130,7 @@ svg {
133130
// ===== Text containers =====
134131
p,
135132
pre,
136-
code,
133+
h1,
137134
h2,
138135
h3,
139136
h4,
@@ -151,21 +148,29 @@ h4,
151148
margin-right: 0.2em;
152149
}
153150
}
151+
}
154152

155-
&:not(:first-child) {
156-
margin-top: var(--text-spacing);
157-
}
153+
p:not(:first-child),
154+
pre:not(:first-child),
155+
.text:not(:first-child) {
156+
margin-top: var(--text-spacing);
157+
}
158+
159+
h1:not(:first-child),
160+
h2:not(:first-child),
161+
h3:not(:first-child),
162+
h4:not(:first-child) {
163+
margin-top: calc(var(--text-spacing) * 3);
158164
}
159165

160166
a,
161-
a:visited,
162-
a:hover {
167+
a:any-link {
163168
color: inherit;
164169
text-decoration: underline;
165170
cursor: pointer;
166171
}
167172

168-
// h1 Page title is always inside u-header
173+
h1,
169174
h2,
170175
h3,
171176
h4 {
@@ -192,30 +197,6 @@ h4 {
192197
min-height: 1em;
193198
}
194199

195-
code,
196-
.code,
197-
code.hljs,
198-
pre>code {
199-
background-color: var(--code);
200-
color: $u-text;
201-
font-size: 1rem;
202-
font-family: 'Courier New', Courier, monospace;
203-
204-
@media print {
205-
border: 1px solid $u-text;
206-
}
207-
}
208-
209-
p>code {
210-
padding-left: 2 * $u-padding-text;
211-
padding-right: $u-padding-text;
212-
}
213-
214-
pre>code {
215-
display: block;
216-
border-radius: 1em;
217-
padding: $u-padding-text;
218-
}
219200

220201
// form elements
221202

css/card.scss

+9-16
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ $u-card-border: none;
6060
// one column only as default
6161
width: 100%;
6262
gap: var(--card-gap); // $u-card-gap;
63-
6463
// center in main container by default
6564
margin: 0 auto;
6665

@@ -71,13 +70,10 @@ $u-card-border: none;
7170

7271
// used a card grid for normal cards (not horizonal)
7372
display: grid;
74-
grid-template-columns: auto;
75-
grid-template-areas: "header" "main" "footer";
76-
grid-template-rows: auto 1fr auto;
73+
grid-template: "header" auto "main" 1fr "footer" auto / auto;
7774
gap: 0;
7875
margin: 0;
7976
padding: 0;
80-
8177
page-break-inside: avoid;
8278
overflow: hidden;
8379
background-color: var(--card-back);
@@ -99,6 +95,10 @@ $u-card-border: none;
9995
height: calc((var(--card-height) - var(--card-gap)) / 2);
10096
}
10197

98+
&.shadow {
99+
box-shadow: var(--dropshadow);
100+
}
101+
102102
// images as first element in card
103103
>svg:first-child,
104104
>img:first-child {
@@ -134,7 +134,6 @@ $u-card-border: none;
134134
aspect-ratio: 1/1;
135135
margin-right: var(--card-padding);
136136
}
137-
138137
}
139138

140139
.main,
@@ -156,7 +155,7 @@ $u-card-border: none;
156155
background-color: inherit;
157156
}
158157

159-
&.autolink a:first-of-type::before {
158+
&.autolink h3>a::before {
160159
position: absolute;
161160
top: 0;
162161
left: 0;
@@ -166,18 +165,15 @@ $u-card-border: none;
166165
}
167166
}
168167

169-
170168
// container marked with class='horizontal' for horizontal oriented cards
171169
// stretching on the whole with with image on the left */
172170
&.horizontal {
173171
--card-width: 100%;
174172
--card-height: 7.2rem;
175173

176174
>.card {
177-
grid-template-areas: "header main" "header footer";
178-
grid-template-columns: max-content auto;
179-
grid-template-rows: 1fr auto;
180-
175+
grid-template: "header main" 1fr "header footer" auto / max-content auto;
176+
181177
>svg:first-child,
182178
>img:first-child {
183179
width: var(--card-image-size);
@@ -186,7 +182,6 @@ $u-card-border: none;
186182
}
187183
}
188184

189-
190185
// Cards with a defined, fixed width can be placed multiple times on one row when the with is giving enough space.
191186
// For these cases the card-container implements the layout allowing centering the card collection in the center of the main content.
192187
// Marking the card-container with class='col280' to provide multiple columns with width 280px.
@@ -196,7 +191,6 @@ $u-card-border: none;
196191
&.col280 {
197192
// N columns of 280px cards with 16px gap
198193
// 280*N + 16*(N-1)) = 280, 576, 872, 1168, ... in reverse with container queries
199-
200194
// 4 columns maximum
201195
width: calc($u-card-width * 4 + $u-card-gap * 3);
202196

@@ -212,7 +206,6 @@ $u-card-border: none;
212206
@container main (width < #{$u-card-width * 2}) {
213207
width: $u-card-width;
214208
}
215-
216209
}
217210

218211
&.col365 {
@@ -226,7 +219,7 @@ $u-card-border: none;
226219
width: calc(365px * 4 + 10px * 3);
227220

228221
// @container main (width < #{$u-card-4col}) {
229-
@container main (width <=#{365px * 4 + 10px * 3}) {
222+
@container main (width <= #{365px * 4 + 10px * 3}) {
230223
width: calc(365px * 3 + 10px * 2);
231224
}
232225

css/code.scss

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// file: code.scss
2+
// styling of regions for code and code-terms
3+
// This is part of the micro css implementation.
4+
5+
// valid code regions are: <pre><code> (block level) and <p><code> (inline)
6+
// re-using some variables from base.scss
7+
8+
// * no need for specifying a ont on code tags as it is monospaced by default.
9+
// * minimal syntax coloring is added
10+
11+
// ===== Colors =====
12+
13+
// ===== main =====
14+
15+
:root {
16+
--code-back: rgb(245 245 230);
17+
--code-text: black;
18+
--code-border: 1px solid var(--code-text);
19+
--code-radius: var(--text-spacing);
20+
}
21+
22+
// ===== Text containers =====
23+
pre:has(>code) {
24+
display: block;
25+
padding: 0; // var(--text-spacing);
26+
font-size: 1rem;
27+
border: var(--code-border);
28+
border-left: var(--code-radius) solid #4060A0;
29+
border-radius: var(--code-radius);
30+
background-color: var(--code-back);
31+
background-image: linear-gradient(transparent 50%, rgb(0 0 0 / 6%) 50%);
32+
background-size: auto 2.4em ;
33+
background-origin: content-box;
34+
background-attachment: local;
35+
36+
&:not(:first-child) {
37+
margin-top: calc(var(--text-spacing) * 3);
38+
}
39+
40+
code {
41+
display: block;
42+
color: var(--code-text);
43+
44+
// font-family: Consolas,Monaco,"Andale Mono","Ubuntu Mono",monospace;
45+
font-size: 1rem;
46+
line-height: 1.2;
47+
padding-left:0.2em;
48+
49+
.comment,.block-comment { color: #7d8b99 }
50+
.property,.tag,.boolean,.number,.function-name,.constant,.symbol { color: #c92c2c }
51+
.selector,.attr-name,.string,.char,.function,.builtin { color: #2f9c0a }
52+
.attr-value, .keyword, .class-name { color: #1990b8; }
53+
54+
@media print {
55+
border: 1px solid var(--code-text);
56+
}
57+
}
58+
}
59+
60+
61+
p > code {
62+
// font-family: Consolas,Monaco,"Andale Mono","Ubuntu Mono",monospace;
63+
font-size: 1rem;
64+
padding: 0 var(--text-spacing);
65+
background-color: var(--code-back);
66+
}

css/doc.scss

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
@use "base";
66
@use "page";
77
@use "card";
8+
@use "code";
9+
@use "iot";
810

911
h2 {
1012
clear: both;

css/page.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
--navbar-back: #{base.$u-primary};
1515
--navbar-color: white;
1616
--navbar-spacing: 0.5em;
17+
18+
--dropshadow: rgb(0 0 0 / 40%) 4px 4px 12px 0;
1719
}
1820

1921
body.sitelayout {
@@ -74,7 +76,7 @@ body.sitelayout {
7476
transition: box-shadow 0.3s ease-in-out;
7577

7678
&:hover {
77-
box-shadow: 0 5px 12px rgb(0 0 0 / 30%);
79+
box-shadow: var(--dropshadow);
7880
}
7981
}
8082
}
@@ -148,6 +150,7 @@ body.sitelayout {
148150

149151
nav {
150152
position: absolute;
153+
background-color: var(--content-back);
151154
min-height: 100%;
152155
width: 24ch;
153156
z-index: 1;

0 commit comments

Comments
 (0)