From 4663e86e2b22ea6fdad19f4241e8cda38cf94884 Mon Sep 17 00:00:00 2001 From: Adam Argyle Date: Wed, 20 Sep 2023 07:29:17 -0700 Subject: [PATCH] adds inner-shadow-highlight variable to inner shadow 1-4 (#399) * adds inner-shadow-highlight variable to inner shadow 1-4 * update test to reflect new prop count --- src/props.shadows.css | 9 +++++---- src/props.shadows.js | 10 ++++++---- test/basic.test.cjs | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/props.shadows.css b/src/props.shadows.css index bd8953be..fc43748a 100644 --- a/src/props.shadows.css +++ b/src/props.shadows.css @@ -3,6 +3,7 @@ :where(html) { --shadow-color: 220 3% 15%; --shadow-strength: 1%; + --inner-shadow-highlight: inset 0 -.5px 0 0 #fff2, inset 0 .5px 0 0 #0007; --shadow-1: 0 1px 2px -1px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)); --shadow-2: 0 3px 5px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 3%)), @@ -36,10 +37,10 @@ 0 41px 33px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 6%)), 0 100px 80px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%)); --inner-shadow-0: inset 0 0 0 1px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)); - --inner-shadow-1: inset 0 1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)); - --inner-shadow-2: inset 0 1px 4px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)); - --inner-shadow-3: inset 0 2px 8px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)); - --inner-shadow-4: inset 0 2px 14px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)); + --inner-shadow-1: inset 0 1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight); + --inner-shadow-2: inset 0 1px 4px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight); + --inner-shadow-3: inset 0 2px 8px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight); + --inner-shadow-4: inset 0 2px 14px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight); } @media (--OSdark) { diff --git a/src/props.shadows.js b/src/props.shadows.js index d6643b1a..4c3fb15b 100644 --- a/src/props.shadows.js +++ b/src/props.shadows.js @@ -4,6 +4,8 @@ const Shadows = { '--shadow-color-@media:dark': '220 40% 2%', '--shadow-strength-@media:dark': '25%', + + '--inner-shadow-highlight': 'inset 0 -.5px 0 0 #fff2, inset 0 .5px 0 0 #0007', '--shadow-1': '0 1px 2px -1px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%))', '--shadow-2': ` @@ -39,10 +41,10 @@ const Shadows = { 0 100px 80px -2px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 7%))`, '--inner-shadow-0': 'inset 0 0 0 1px hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%))', - '--inner-shadow-1': 'inset 0 1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%))', - '--inner-shadow-2': 'inset 0 1px 4px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%))', - '--inner-shadow-3': 'inset 0 2px 8px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%))', - '--inner-shadow-4': 'inset 0 2px 14px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%))', + '--inner-shadow-1': 'inset 0 1px 2px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight)', + '--inner-shadow-2': 'inset 0 1px 4px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight)', + '--inner-shadow-3': 'inset 0 2px 8px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight)', + '--inner-shadow-4': 'inset 0 2px 14px 0 hsl(var(--shadow-color) / calc(var(--shadow-strength) + 9%)), var(--inner-shadow-highlight)', } export default Shadows diff --git a/test/basic.test.cjs b/test/basic.test.cjs index c5380b8d..6aaa5805 100644 --- a/test/basic.test.cjs +++ b/test/basic.test.cjs @@ -4,7 +4,7 @@ const OpenProps = require('../dist/open-props.cjs') const OPtokens = require('../open-props.tokens.json') test('Should have an all included import', t => { - t.is(Object.keys(OpenProps).length, 1610) + t.is(Object.keys(OpenProps).length, 1612) }) test('Import should have animations', async t => {