generoi / genero-design-system

https://gds.generogrowth.com/
MIT License
4 stars 0 forks source link

refactor(variables): prefix all variables with gds #52

Closed oxyc closed 3 years ago

oxyc commented 3 years ago

This was just some quick sed + vim macro magic to get the changes but I havent at all looked if there were failed edge cases.

Deprecations file should not be included in the actual build and if we choose to provide it, it would be for sites to ease migrations.

taromorimoto commented 3 years ago

Ooh! Nice! Let's merge!

oxyc commented 3 years ago

⚠ BREAKING CHANGES

find -E . -type f -not -path "./node_modules/*" -not -path "./vendor/*" -regex ".*\.(js|css|scss|tsx|php)" -exec sed -i '' -E 's/--(color|spacing|body|heading|label|paragraph|tag|button|text-button|navigation|card|media-card|logo-grid-item|icon|accordion)/--gds-\1/g' {} +

find -E . -type f -not -path "./node_modules/*" -not -path "./vendor/*" -regex ".*\.(js|css|scss|tsx|php)" -exec sed -i '' -E 's/spacing-xxxs/spacing-3xs/g' {} +
find -E . -type f -not -path "./node_modules/*" -not -path "./vendor/*" -regex ".*\.(js|css|scss|tsx|php)" -exec sed -i '' -E 's/spacing-xxs/spacing-2xs/g' {} +
find -E . -type f -not -path "./node_modules/*" -not -path "./vendor/*" -regex ".*\.(js|css|scss|tsx|php)" -exec sed -i '' -E 's/spacing-xxl/spacing-2xl/g' {} +
find -E . -type f -not -path "./node_modules/*" -not -path "./vendor/*" -regex ".*\.(js|css|scss|tsx|php)" -exec sed -i '' -E 's/spacing-xxxl/spacing-3xl/g' {} +
--heading-2xl-font-family: var(--heading-xxl-font-family);
--heading-2xl-font-weight: var(--heading-xxl-font-weight);
--heading-2xl-font-size: var(--heading-xxl-font-size);
--heading-2xl-line-height: var(--heading-xxl-line-height);
--heading-2xl-text-transform: var(--heading-xxl-text-transform);
--heading-2xl-letter-spacing: var(--heading-xxl-letter-spacing);
--heading-2xl-margin-top: var(--heading-xxl-margin-top);
--heading-2xl-margin-bottom: var(--heading-xxl-margin-bottom);

--spacing-3xs: var(--spacing-xxxs);
--spacing-2xs: var(--spacing-xxs);
--spacing-2xl: var(--spacing-xxl);
--spacing-3xl: var(--spacing-xxxl);
--color-primary: var(--color-ui-03);
--color-secondary: var(--color-ui-04);
--border-color-light: #dddddd;
--background-color-primary: var(--color-ui-background-01);
--background-color-secondary: var(--color-ui-background-02);
--text-color-primary: var(--color-black);
toffebjorkskog commented 3 years ago

Nice! Great with the string replacement snippet