-
Notifications
You must be signed in to change notification settings - Fork 201
chore: harden recently updated scripts #3680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,16 +29,31 @@ body { | |
} | ||
|
||
.spectrum { | ||
/* Gradient that changes with the color theme. */ | ||
--spectrum-examples-gradient: linear-gradient(45deg, var(--spectrum-magenta-1500), var(--spectrum-blue-1500)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These variables are specific to the Storybook so I think it makes sense to move their definitions here instead of inside the tokens package. I didn't remove them though in case downstream customers are leveraging them as well. |
||
|
||
/* Gradients that do not change with the color theme, for use in static color backgrounds. */ | ||
--spectrum-examples-gradient-static-black: linear-gradient(45deg, rgb(255 241 246), rgb(238 245 255)); | ||
--spectrum-examples-gradient-static-white: linear-gradient(45deg, rgb(64 0 22), rgb(14 24 67)); | ||
|
||
color: var(--spectrum-neutral-content-color-default); | ||
background-color: var(--spectrum-background-base-color); | ||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0%); | ||
-webkit-tap-highlight-color: rgb(0, 0, 0, 0%); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just an auto-fix ala VSCode stylelinting |
||
} | ||
|
||
.spectrum.spectrum--legacy { | ||
color: var(--spectrum-neutral-content-color-default); | ||
background-color: var(--spectrum-background-layer-1-color); | ||
} | ||
|
||
.spectrum .spectrum-examples-static-black { | ||
background: var(--spectrum-examples-gradient-static-black); | ||
} | ||
|
||
.spectrum .spectrum-examples-static-white { | ||
background: var(--spectrum-examples-gradient-static-white); | ||
} | ||
|
||
/* Hide the SVG elements that only include references */ | ||
svg:has(symbol):not(:has(use)) { | ||
display: none; | ||
|
@@ -58,7 +73,7 @@ svg:has(symbol):not(:has(use)) { | |
line-height: normal; | ||
letter-spacing: normal; | ||
text-transform: none; | ||
border-block-end: 1px solid hsla(203deg, 50%, 30%, 15%); | ||
border-block-end: 1px solid hsl(203deg, 50%, 30%, 15%); | ||
} | ||
|
||
/* Force the modal wrapper to be contained by the frame not the viewport */ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,6 @@ | |
# After migrating from our old build system, there are a lot of empty folders hanging out still | ||
# This script aims to clean up those folders | ||
|
||
# Legacy tools folder (included storybook & generator) | ||
# test -d "tools" && rm -rf tools | ||
|
||
test -d "tools" && rm -rf tools | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why this is still here - we like and need the tools folder!! |
||
|
||
# Remove deprecated files | ||
for folder in components/*; do | ||
# Only processing nested folders, not top-level files | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ export const format = ({ dictionary, platform, file, options }) => { | |
); | ||
|
||
const convertRef = (ref) => { | ||
return ref.replace(/\{(.*?)\}/g, `var(--${prefix}-$1)`); | ||
return ref?.toString()?.replace(/\{(.*?)\}/g, `var(--${prefix}-$1)`); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes ref is a number so this converts it to a string so we can tidy it up first |
||
}; | ||
|
||
const deconstructSets = (obj, scope = undefined) => { | ||
|
@@ -23,11 +23,11 @@ export const format = ({ dictionary, platform, file, options }) => { | |
if (data.ref) { | ||
data.ref = convertRef(data.ref); | ||
|
||
if (data.ref === data.value) { | ||
if (data.ref?.toString() === data.value?.toString()) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This just ensures that the ref is converted to the same type before comparing (sometimes they're numbers). |
||
delete data.ref; | ||
} | ||
} | ||
|
||
if (data.sets) { | ||
data = deconstructSets(data, context); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These exports don't seem to be working so we're linking just all the files!