-
Notifications
You must be signed in to change notification settings - Fork 273
Copilot supported conversion to SCSS Modules #13013
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: latest
Are you sure you want to change the base?
Changes from all commits
47e9bb1
1f6a4d4
82b3c26
8db0a50
ed3da93
719c18f
0a8dcd6
c067875
c395ea7
d49af8a
622f783
b0c19da
0df1134
45fc3cf
9fa6533
14e8656
65e904f
a5a4f48
b990200
12e3d65
35e5a23
a45e8b0
2080e0b
6f54014
e5a75e0
b5ef53f
bf32ec3
49ff13f
04a7635
3206fef
a934dee
3cc0c00
d9cee84
088c588
e4818ff
930246d
db50f52
bacaa6a
71b14f1
b314a6f
e69cca0
709273b
794823f
9894ef9
74fe3ff
92301ef
ffbfe84
171f5ec
e5b4947
1b2192e
8207f9f
3c4bac5
e021f21
58b0680
152a72f
4116132
2ea2941
011dbe6
820427b
34001ba
89b97d0
41505a4
ec34846
c93c706
91af316
db315ab
72f4f6d
239228a
a093f24
3030ab7
a380bf2
319456c
174ca80
7a54248
e18a5d2
89c2246
ceaacfe
1f9452c
6afdccc
19648c4
80158c7
b9bd6da
935a243
5e0d3f2
0ad1d28
2879b6d
f28ed32
25a81fb
f34f953
f0bc46f
f162b1c
10fc835
5c07a16
cec63db
6ffd94c
b8a808f
72fbe34
6890039
4e9ec7b
dca80c6
5f028bd
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 |
|---|---|---|
|
|
@@ -61,6 +61,34 @@ const storybookConfig: StorybookConfig = { | |
| transcludeMarkdown: true, | ||
| }, | ||
| }, | ||
| { | ||
| name: '@storybook/addon-styling-webpack', | ||
| options: { | ||
| rules: [ | ||
| { | ||
| test: /\.module\.scss$/, | ||
| use: [ | ||
| 'style-loader', | ||
| { | ||
| loader: 'css-loader', | ||
| options: { | ||
| modules: true, | ||
| importLoaders: 1, | ||
| esModule: false, | ||
| }, | ||
| }, | ||
| { | ||
| loader: 'sass-loader', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| test: /(?<!\.module)\.scss$/, | ||
| use: ['style-loader', 'css-loader', 'sass-loader'], | ||
|
Contributor
Author
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. config enabling global scss files |
||
| }, | ||
| ], | ||
| }, | ||
| }, | ||
| ], | ||
| env: config => ({ | ||
| ...config, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import { Preview } from '@storybook/react-webpack5'; | |
| import GlobalStyles from '../src/app/legacy/psammead/psammead-styles/src/global-styles'; | ||
| import DocsDecorator from './DocsDecorator'; | ||
| import ThemeProvider from '../src/app/components/ThemeProvider'; | ||
| import ThemeProviderSCSSModules from '#app/components/ThemeProviderSCSSModules'; | ||
| import { ServiceContextProvider } from '../src/app/contexts/ServiceContext'; | ||
| import { ToggleContextProvider } from '../src/app/contexts/ToggleContext'; | ||
| import { UserContextProvider } from '../src/app/contexts/UserContext'; | ||
|
|
@@ -228,12 +229,17 @@ const preview: Preview = { | |
| pageData={pageDataFixture} | ||
| > | ||
| <UserContextProvider> | ||
| <ThemeProvider | ||
| service={context.globals.service.service} | ||
| <ThemeProviderSCSSModules | ||
| service="mundo" | ||
| variant={context.globals.service.variant} | ||
| > | ||
| <Story /> | ||
| </ThemeProvider> | ||
| <ThemeProvider | ||
| service={context.globals.service.service} | ||
| variant={context.globals.service.variant} | ||
| > | ||
| <Story /> | ||
| </ThemeProvider> | ||
| </ThemeProviderSCSSModules> | ||
|
Contributor
Author
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. here the new ThemeProviderSCSSModules is enabled alongside the emotion one. It is hardcoded to the mundo theme at this stage |
||
| </UserContextProvider> | ||
| </EventTrackingContextProvider> | ||
| </RequestContextProvider> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,5 +24,16 @@ | |
| "request": "launch", | ||
| "command": "cd ws-nextjs-app && nvm use && yarn dev" | ||
| }, | ||
| { | ||
| "name": "Storybook debug", | ||
| "type": "node-terminal", | ||
| "request": "launch", | ||
| "command": "yarn storybook", | ||
| "serverReadyAction": { | ||
| "pattern": "Local:.+(https?://[^:]+:[0-9]+)", | ||
| "uriFormat": "%s", | ||
| "action": "debugWithChrome" | ||
| } | ||
| }, | ||
|
Contributor
Author
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. bit of useful vscode config to debug storybook in vscode |
||
| ] | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,9 @@ | |
| "sideEffects": [ | ||
| "./src/app/legacy/psammead/moment-timezone-include/**/*.*", | ||
| "./src/app/legacy/psammead/psammead-locales/**/*.*", | ||
| "./cypress/**/*.*" | ||
| "./cypress/**/*.*", | ||
| "**/*.scss", | ||
| "**/*.css" | ||
| ], | ||
| "workspaces": { | ||
| "packages": [ | ||
|
|
@@ -166,6 +168,7 @@ | |
| "@loadable/webpack-plugin": "5.15.2", | ||
| "@storybook/addon-a11y": "10.3.5", | ||
| "@storybook/addon-docs": "10.3.5", | ||
| "@storybook/addon-styling-webpack": "^3.0.0", | ||
| "@storybook/builder-webpack5": "10.3.5", | ||
| "@storybook/cli": "10.3.5", | ||
| "@storybook/react-webpack5": "10.3.5", | ||
|
|
@@ -174,6 +177,7 @@ | |
| "@testing-library/react": "16.3.1", | ||
| "@testing-library/react-hooks": "8.0.1", | ||
| "@testing-library/user-event": "14.6.1", | ||
| "@types/identity-obj-proxy": "3.0.2", | ||
| "@types/jest": "30.0.0", | ||
| "@types/js-cookie": "^3.0.3", | ||
| "@types/jsdom": "27.0.0", | ||
|
|
@@ -200,6 +204,7 @@ | |
| "compression-webpack-plugin": "11.1.0", | ||
| "copy-webpack-plugin": "13.0.1", | ||
| "crypto": "1.0.1", | ||
| "css-loader": "7.1.2", | ||
| "cypress": "15.11.0", | ||
| "cypress-axe": "1.7.0", | ||
| "cypress-multi-reporters": "2.0.5", | ||
|
|
@@ -220,6 +225,7 @@ | |
| "eslint-plugin-react-hooks": "5.2.0", | ||
| "happy-dom": "20.8.9", | ||
| "husky": "9.1.7", | ||
| "identity-obj-proxy": "3.0.0", | ||
| "jest": "30.3.0", | ||
| "jest-environment-jsdom": "30.2.0", | ||
| "jest-expect-message": "1.1.3", | ||
|
|
@@ -229,23 +235,28 @@ | |
| "jest-silent-reporter": "0.6.0", | ||
| "jsdom": "27.0.0", | ||
| "lighthouse": "13.0.1", | ||
| "mini-css-extract-plugin": "2.9.4", | ||
| "minimist": "1.2.8", | ||
| "mkdirp": "3.0.1", | ||
| "mocha-junit-reporter": "2.2.1", | ||
| "npm-run-all2": "8.0.4", | ||
| "prettier": "3.8.1", | ||
| "puppeteer": "24.22.3", | ||
| "retry": "0.13.1", | ||
| "sass": "1.94.2", | ||
| "sass-loader": "16.0.5", | ||
|
Contributor
Author
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. copilot recommended packages to support SCSS |
||
| "start-server-nestjs-webpack-plugin": "2.2.5", | ||
| "storybook": "10.3.5", | ||
| "stream-browserify": "3.0.0", | ||
| "strip-ansi": "7.1.2", | ||
| "style-loader": "4.0.0", | ||
| "supertest": "7.2.2", | ||
| "terser-webpack-plugin": "5.3.14", | ||
| "timemachine": "0.3.2", | ||
| "ts-jest": "29.4.9", | ||
| "ts-loader": "9.5.4", | ||
| "typescript": "5.9.3", | ||
| "typescript-plugin-css-modules": "5.2.0", | ||
| "wait-on": "9.0.3", | ||
| "webpack": "5.106.0", | ||
| "webpack-bundle-analyzer": "5.3.0", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| @use '@scss/themeTokens' as theme; | ||
|
|
||
| .link { | ||
| @include theme.fontSizes-gel-font-size(pica); | ||
| @include theme.fontVariants-gel-font-variant('serif-bold'); | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| text-decoration: none; | ||
| overflow-x: hidden; | ||
| overflow-y: hidden; | ||
| line-clamp: 4; | ||
| -webkit-line-clamp: 4; | ||
| -webkit-box-orient: vertical; | ||
| color: theme.$palette-grey-8; | ||
|
|
||
| &:hover, | ||
| &:focus { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| &:visited { | ||
| color: theme.$palette-grey-6; | ||
| } | ||
|
|
||
| &::before { | ||
| bottom: 0; | ||
| content: ''; | ||
| left: 0; | ||
| overflow: hidden; | ||
| position: absolute; | ||
| right: 0; | ||
| top: 0; | ||
| z-index: 1; | ||
| } | ||
|
|
||
| // Dark UI override | ||
| :global([data-is-dark-ui='true']) & { | ||
| color: theme.$palette-grey-2; | ||
| } | ||
| } | ||
|
|
||
| .promoBox { | ||
| position: relative; | ||
| background-color: theme.$palette-white; | ||
| padding: #{theme.$spacings-double}; | ||
| padding-inline-end: #{theme.pixelsToRem-px-to-rem(38)}; | ||
| height: auto; | ||
| display: block; | ||
| width: 100%; | ||
|
|
||
| // Dark UI override | ||
| :global([data-is-dark-ui='true']) & { | ||
| background-color: theme.$palette-grey-7; | ||
| } | ||
|
|
||
| // Opera Mini overrides | ||
| :global(.is-opera-mini) & { | ||
| position: relative; | ||
| background-color: theme.$palette-white; | ||
| padding: #{theme.$spacings-double}; | ||
| margin-bottom: #{theme.$spacings-double}; | ||
| width: calc(100% - #{theme.$spacings-full}); | ||
|
|
||
| :global([data-is-dark-ui='true']) & { | ||
| background-color: theme.$palette-grey-3; | ||
| } | ||
|
|
||
| @media (min-width: #{theme.$mediaQueries-group-2-min-width-bp}) { | ||
| width: calc(50% - #{theme.$spacings-double}); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .timestamp { | ||
| margin-top: #{theme.$spacings-full}; | ||
|
|
||
| // Dark UI override | ||
| :global([data-is-dark-ui='true']) & { | ||
| color: theme.$palette-grey-1; | ||
| } | ||
| } | ||
|
|
||
| .chevron { | ||
| position: absolute; | ||
| top: 50%; | ||
| transform: translateY(-50%); | ||
| inset-inline-end: #{theme.pixelsToRem-px-to-rem(12)}; | ||
| fill: currentColor; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| @use '@scss/themeTokens' as theme; | ||
|
|
||
| .promo { | ||
| & ul { | ||
| list-style: none; | ||
| padding-inline-start: 0; | ||
| margin: 0; | ||
| display: flex; | ||
| flex-direction: column; | ||
| gap: #{theme.$spacings-full}; | ||
| width: 100%; | ||
| } | ||
|
|
||
| // Opera Mini overrides | ||
| :global(.is-opera-mini) & { | ||
| list-style: none; | ||
| padding-inline-start: 0; | ||
| margin: 0; | ||
| } | ||
| } | ||
|
|
||
| .list { | ||
| display: flex; | ||
| flex-shrink: 0; | ||
| margin-inline: #{theme.$spacings-full}; | ||
|
|
||
| &:last-of-type { | ||
| margin-bottom: #{theme.$spacings-triple}; | ||
| } | ||
|
|
||
| @media #{theme.$mediaQueries-forced-colours} { | ||
| border: solid #{theme.pixelsToRem-px-to-rem(3)} transparent; | ||
| } | ||
|
|
||
| @media (min-width: #{theme.$mediaQueries-group-2-min-width-bp}) { | ||
| margin-inline: #{theme.$spacings-double}; | ||
| } | ||
|
|
||
| @media (min-width: #{theme.$mediaQueries-group-3-min-width-bp}) { | ||
| margin-inline: #{theme.$spacings-double}; | ||
| } | ||
|
|
||
| @media (min-width: #{theme.$mediaQueries-group-4-min-width-bp}) { | ||
| margin-inline: 0; | ||
| } | ||
|
|
||
| // Opera Mini overrides | ||
| :global(.is-opera-mini) & { | ||
| @media (max-width: #{theme.$mediaQueries-group-0-max-width-bp}) { | ||
| margin-inline: #{theme.$spacings-full}; | ||
| } | ||
|
|
||
| @media (min-width: #{theme.$mediaQueries-group-2-min-width-bp}) { | ||
| margin-inline: #{theme.$spacings-double}; | ||
| } | ||
|
|
||
| @media (min-width: #{theme.$mediaQueries-group-4-min-width-bp}) { | ||
| margin-inline: 0; | ||
| } | ||
| } | ||
| } |
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.
config enabling module scss files in storybook