Skip to content

Commit

Permalink
Created durations.css to address #415; (#424)
Browse files Browse the repository at this point in the history
* Created durations.css to address #415;

* cut v1.6.3 with new durations.css

---------

Co-authored-by: Adam Argyle <[email protected]>
  • Loading branch information
jon-stumpf and argyleink committed Sep 29, 2023
1 parent 6c6898b commit c9272aa
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 2 deletions.
7 changes: 6 additions & 1 deletion docsite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h1><span>CSS</span> <span>variables.</span></h1>
</li>
</ul>
<small>
v1.6.2
v1.6.3
<span class="license">
<svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16">
<path fill-rule="evenodd" d="M8.75.75a.75.75 0 00-1.5 0V2h-.984c-.305 0-.604.08-.869.23l-1.288.737A.25.25 0 013.984 3H1.75a.75.75 0 000 1.5h.428L.066 9.192a.75.75 0 00.154.838l.53-.53-.53.53v.001l.002.002.002.002.006.006.016.015.045.04a3.514 3.514 0 00.686.45A4.492 4.492 0 003 11c.88 0 1.556-.22 2.023-.454a3.515 3.515 0 00.686-.45l.045-.04.016-.015.006-.006.002-.002.001-.002L5.25 9.5l.53.53a.75.75 0 00.154-.838L3.822 4.5h.162c.305 0 .604-.08.869-.23l1.289-.737a.25.25 0 01.124-.033h.984V13h-2.5a.75.75 0 000 1.5h6.5a.75.75 0 000-1.5h-2.5V3.5h.984a.25.25 0 01.124.033l1.29.736c.264.152.563.231.868.231h.162l-2.112 4.692a.75.75 0 00.154.838l.53-.53-.53.53v.001l.002.002.002.002.006.006.016.015.045.04a3.517 3.517 0 00.686.45A4.492 4.492 0 0013 11c.88 0 1.556-.22 2.023-.454a3.512 3.512 0 00.686-.45l.045-.04.01-.01.006-.005.006-.006.002-.002.001-.002-.529-.531.53.53a.75.75 0 00.154-.838L13.823 4.5h.427a.75.75 0 000-1.5h-2.234a.25.25 0 01-.124-.033l-1.29-.736A1.75 1.75 0 009.735 2H8.75V.75zM1.695 9.227c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327l-1.305 2.9zm10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327l-1.305 2.9z"></path>
Expand Down Expand Up @@ -458,6 +458,11 @@ <h4>File Sizes</h4>
</div>
</div>

<div class="size"><strong>1.4</strong>kB</div>
<div class="file">
<a href="https://github.com/argyleink/open-props/blob/main/src/props.durations.css">durations.css</a>
</div>

<div class="size"><strong>0.2</strong>kB</div>
<div class="file">
<a href="https://github.com/argyleink/open-props/blob/main/src/props.easing.css">easings.css</a>
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "open-props",
"author": "Adam Argyle",
"license": "MIT",
"version": "1.6.2",
"version": "1.6.3",
"repository": {
"type": "git",
"url": "https://github.com/argyleink/open-props"
Expand Down Expand Up @@ -77,6 +77,7 @@
"./oklch-hues": "./oklch-hues.min.css",
"./cyan": "./cyan.min.css",
"./cyan-hsl": "./cyan-hsl.min.css",
"./durations": "./durations.min.css",
"./easings": "./easings.min.css",
"./fonts": "./fonts.min.css",
"./gradients": "./gradients.min.css",
Expand Down Expand Up @@ -201,6 +202,7 @@
"lib:animations": "postcss src/props.animations.css -o animations.min.css",
"lib:aspects": "postcss src/props.aspects.css -o aspects.min.css",
"lib:borders": "postcss src/props.borders.css -o borders.min.css",
"lib:durations": "postcss src/extra/durations.css -o durations.min.css",
"lib:easing": "postcss src/props.easing.css -o easings.min.css",
"lib:fonts": "postcss src/props.fonts.css -o fonts.min.css",
"lib:gradients": "postcss src/props.gradients.css -o gradients.min.css",
Expand Down
78 changes: 78 additions & 0 deletions src/extra/durations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
:where(html) {
--minute: 60s;
--hour: calc( 60 * var(--minute));
--day: calc( 24 * var(--hour));
--week: calc( 7 * var(--day));
--fortnight: calc( 14 * var(--day));
--month: calc( 30 * var(--day));
--quarter: calc( 13 * var(--week));
--year: calc(365 * var(--day));
--leap-year: calc( 4 * var(--year));
--decade: calc( 10 * var(--year));
--generation: calc( 3 * var(--decade));
--lifetime: calc( 8 * var(--decade));

--work-day: calc( 8 * var(--hour));
--work-week: calc( 5 * var(--day));

--blink: .1s;
--sneeze: .5s;
--brief-moment: 15s;
--pause: 10s;
--unhealthy-pause: 30s;

/*
* https://en.wikipedia.org/wiki/List_of_unusual_units_of_measurement
*/
--moment: 90s;
--kermit: calc(14.4 * var(--minute));
--microfortnight: 1.2096s;

/* Approximate astronomical durations */
--sidereal-day: calc((23 * var(--hour)) + (56 * var(--minute)) + 4.091s);
--iss-orbit: calc(91.5 * var(--minute));
--lunar-month: calc(29.5 * var(--day));
--venus-year: calc(225 * var(--day));
--sol: 88775s;
--mars-year: calc(668.5907 * var(--sol));

/*
* 10 Little-Known Units of Time
* https://www.mentalfloss.com/article/60080/10-little-known-units-time
*/
--atom: .15957s;
--ghurry: calc(24 * var(--minute));
--lustre: calc(5 * var(--year));
--mileway: calc(20 * var(--minute));
--nundine: calc(9 * var(--day));
--nychthemeron: var(--day);
--punct: calc(15 * var(--minute));
--quadrant: calc(6 * var(--hour));
--quinzieme: calc(15 * var(--day));
--scruple: calc(24 * var(--minute));

/*
* The Potrzebie System of Weights and Measures
* https://madcoversite.com/mad033-36.html
* https://webmadness.net/resources/The-Potrzebie-system-of-weights-and-measures.pdf
*
* There is an inconsistency in the definitions where 1 wolverton = 0.00001 clarke.
* Calculating fractions of clarkes suggests that a 1 wolverton = 0.00000001 clarke.
*/
--clarke: var(--sidereal-day);
--wood: calc(0.1 * var(--clarke));
--martin: calc(0.01 * var(--wood));
--kovac: calc(0.01 * var(--martin));
--wolverton: calc(0.001 * var(--kovac));
--mingo: calc(10 * var(--clarke));
--cowznofski: calc(10 * var(--mingo));

/*
* https://en.wikipedia.org/wiki/List_of_humorous_units_of_measurement
*/
--friedman: calc(6 * var(--month));
--jiffy: 0.01s;
--microcentury: calc((52 * var(--minute)) + 35.7s);
--nanocentury: 3.156s;
--scaramucci: calc(11 * var(--day));
}

0 comments on commit c9272aa

Please sign in to comment.