Skip to content

Commit d257bb8

Browse files
add newspaper style demo
1 parent 1240b6f commit d257bb8

File tree

2 files changed

+9
-48
lines changed

2 files changed

+9
-48
lines changed

css-gap-decorations/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ This directory contains demos that showcase the use of [CSS Gap Decorations](htt
1010
* [Notebook](https://microsoftedge.github.io/Demos/css-gap-decorations/notebook.html)
1111
* [Calendar](https://microsoftedge.github.io/Demos/css-gap-decorations/calendar.html)
1212
* [Personal site](https://microsoftedge.github.io/Demos/css-gap-decorations/personal-site.html)
13-
<!-- * [The Daily Oddity](https://microsoftedge.github.io/Demos/css-gap-decorations/the-daily-oddity.html) -->
13+
* [The Daily Oddity](https://microsoftedge.github.io/Demos/css-gap-decorations/the-daily-oddity.html)
1414

1515
## Developer playground
1616

css-gap-decorations/the-daily-oddity.html

Lines changed: 8 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -140,59 +140,20 @@
140140

141141
main {
142142
margin-block-end: 3rem;
143-
display: grid;
144-
grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
143+
144+
display: flex;
145+
flex-wrap: wrap;
145146
gap: 3rem;
146-
/* These seem to work. */
147+
147148
column-rule: 2px solid var(--text);
148149
column-rule-break: intersection;
149-
column-rule-outset: .5rem;
150-
/* These don't work yet. */
151-
row-rule-width: 2px;
152-
row-rule-style: solid;
153-
row-rule-color: var(--text);
154-
row-rule-break: intersection;
155-
row-rule-outset: -1rem;
156-
}
157-
158-
@property --unitless-val {
159-
syntax: '<integer>';
160-
inherits: true;
161-
initial-value: 0;
162-
}
150+
column-rule-outset: 0;
163151

164-
@property --_u {
165-
syntax: '<length>';
166-
inherits: true;
167-
initial-value: 0;
152+
row-rule: 2px solid var(--text);
168153
}
169154

170-
:root {
171-
--val: calc(100vw / 25rem);
172-
/* use any length unit (px, em, ex, ch, rem, ...)*/
173-
174-
/* we multiply then divide with the biggest value to get one unit */
175-
--_m: 3.35544e07;
176-
/* this value depend on the browser */
177-
--_u: calc(var(--val)*var(--_m));
178-
--unit: calc(var(--_u)/var(--_m));
179-
/* = 1em */
180-
181-
--unitless-val: tan(atan2(var(--val), var(--unit)));
182-
/* = 25 */
183-
/* In the near future we can do
184-
--unitless-val: calc(var(--val)/var(--unit));
185-
*/
186-
}
187-
188-
@supports (display: masonry) {
189-
190-
191-
main {
192-
display: masonry;
193-
/* Auto-fit/fill doesn't work yet in masonry. */
194-
grid-template-columns: repeat(var(--unitless-val), 1fr);
195-
}
155+
main article {
156+
flex: 1 1 180px;
196157
}
197158

198159
article a {

0 commit comments

Comments
 (0)