Repository navigation
Stylelint: configure wp theme style tokens build & linting #111395
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
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 |
|---|---|---|
|
|
@@ -2,18 +2,18 @@ | |
|
|
||
| .jetpack-footer { | ||
| display: flex; | ||
| border-top: var(--wpds-border-width-xs, 1px) solid var(--wpds-color-stroke-surface-neutral-weak, #e0e0e0); | ||
| border-top: var(--wpds-border-width-xs) solid var(--wpds-color-stroke-surface-neutral-weak); | ||
| box-sizing: border-box; | ||
| color: var(--wpds-color-fg-content-neutral, #1e1e1e); | ||
| font-size: var(--wpds-font-size-md, 13px); | ||
| color: var(--wpds-color-fg-content-neutral); | ||
| font-size: var(--wpds-typography-font-size-md); | ||
| padding: var(--wpds-dimension-padding-xl) var(--wpds-dimension-padding-2xl); | ||
| width: 100%; | ||
|
|
||
| .jetpack-footer__menu-item { | ||
| font-family: var(--wpds-font-family-body); | ||
| font-size: var(--wpds-font-size-sm, 12px); | ||
| font-weight: var(--wpds-font-weight-regular, 400); | ||
| line-height: var(--wpds-font-line-height-xs, 16px); | ||
| font-family: var(--wpds-typography-font-family-body); | ||
| font-size: var(--wpds-typography-font-size-sm); | ||
| font-weight: var(--wpds-typography-font-weight-regular); | ||
| line-height: var(--wpds-typography-line-height-xs); | ||
| text-underline-offset: 0.2em; | ||
|
|
||
| &:any-link, | ||
|
|
@@ -44,10 +44,10 @@ | |
| } | ||
|
|
||
| .jetpack-footer__logo-text { | ||
|
Contributor
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. Is this an opportunity to use the |
||
| font-family: var(--wpds-font-family-body); | ||
| font-size: var(--wpds-font-size-md); | ||
| font-weight: var(--wpds-font-weight-regular); | ||
| line-height: var(--wpds-font-line-height-sm); | ||
| font-family: var(--wpds-typography-font-family-body); | ||
| font-size: var(--wpds-typography-font-size-md); | ||
| font-weight: var(--wpds-typography-font-weight-regular); | ||
| line-height: var(--wpds-typography-line-height-sm); | ||
| } | ||
|
|
||
| a.jetpack-footer__a8c { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,12 +9,12 @@ body.is-section-podcasting { | |
| // which Calypso's unlayered button reset overrides. Restore the package | ||
| // defaults (16px horizontal padding) and add a separator under the tab bar. | ||
| .podcast__tabs-bar { | ||
| border-block-end: 1px solid var( --wpds-color-stroke-base-tertiary, #dcdcde ); | ||
| border-block-end: 1px solid var( --wpds-color-stroke-surface-neutral ); | ||
| margin-block-end: 24px; | ||
| } | ||
|
|
||
| .podcast__tabs [role='tab'] { | ||
| padding-inline: var( --wpds-dimension-padding-lg, 16px ); | ||
| padding-inline: var( --wpds-dimension-padding-lg ); | ||
| } | ||
|
|
||
| .podcast__section-header { | ||
|
|
@@ -29,14 +29,14 @@ body.is-section-podcasting { | |
| font-size: 28px; | ||
| font-weight: 400; | ||
| line-height: 1.2; | ||
| color: var( --wpds-color-fg-content-neutral, #1e1e1e ); | ||
| color: var( --wpds-color-fg-content-neutral ); | ||
| } | ||
|
|
||
| .podcast__section-description { | ||
| margin: 0; | ||
| font-size: 13px; | ||
| line-height: 1.4; | ||
| color: var( --wpds-color-fg-content-neutral-weak, #757575 ); | ||
| color: var( --wpds-color-fg-content-neutral-weak ); | ||
| } | ||
|
|
||
| .podcast__directory-list { | ||
|
|
@@ -47,7 +47,7 @@ body.is-section-podcasting { | |
|
|
||
| .podcast__directory-row { | ||
| padding-block: 12px; | ||
| border-block-end: 1px solid var( --wpds-color-stroke-base-tertiary, #dcdcde ); | ||
| border-block-end: 1px solid var( --wpds-color-stroke-surface-neutral ); | ||
|
|
||
| &:last-child { | ||
| border-block-end: none; | ||
|
|
@@ -109,30 +109,30 @@ body.is-section-podcasting { | |
| justify-content: center; | ||
| flex-direction: column; | ||
| gap: 4px; | ||
| border: 2px dashed var( --wpds-color-stroke-base-tertiary, #c3c4c7 ); | ||
| background: var( --wpds-color-bg-surface-base-secondary, #f6f7f7 ); | ||
| border: 2px dashed var( --wpds-color-stroke-surface-neutral ); | ||
| background: var( --wpds-color-bg-surface-neutral-weak ); | ||
| transition: border-color 0.15s ease, background-color 0.15s ease; | ||
|
|
||
| &::before { | ||
| content: '+'; | ||
| font-size: 28px; | ||
| font-weight: 400; | ||
| line-height: 1; | ||
| color: var( --wpds-color-fg-content-neutral-weak, #757575 ); | ||
| color: var( --wpds-color-fg-content-neutral-weak ); | ||
| } | ||
|
|
||
| &:hover:not( :disabled ), | ||
| &:focus-visible { | ||
| border-color: var( --wpds-color-stroke-status-info-strong, #007cba ); | ||
| background: var( --wpds-color-bg-surface-base, #fff ); | ||
| border-color: var( --wpds-color-stroke-surface-info-strong ); | ||
| background: var( --wpds-color-bg-surface-neutral-strong ); | ||
| } | ||
| } | ||
|
|
||
| .podcast__settings-cover .podcast-cover-image-setting__preview.is-blank | ||
| .podcast-cover-image-setting__placeholder { | ||
| font-style: normal; | ||
| font-size: 12px; | ||
| color: var( --wpds-color-fg-content-neutral-weak, #757575 ); | ||
| color: var( --wpds-color-fg-content-neutral-weak ); | ||
| } | ||
|
|
||
| .podcast__settings-cover | ||
|
|
@@ -205,7 +205,7 @@ body.is-section-podcasting { | |
| inset-block-start: 0; | ||
| inset-inline-end: 16px; | ||
| padding: 4px 10px; | ||
| background: var( --wpds-color-bg-content-neutral-medium, #50575e ); | ||
| background: var( --wpds-color-bg-interactive-neutral-strong ); | ||
|
Contributor
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. Looks like we're using a |
||
| color: #fff; | ||
| font-size: 10px; | ||
| font-weight: 600; | ||
|
|
@@ -216,7 +216,7 @@ body.is-section-podcasting { | |
| z-index: 1; | ||
|
|
||
| &.is-recommended { | ||
| background: var( --wpds-color-bg-status-success-strong, #1a8d36 ); | ||
| background: var( --wpds-color-stroke-surface-success-strong ); | ||
|
Contributor
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. We shouldn't be using a |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -249,7 +249,7 @@ body.is-section-podcasting { | |
| background: | ||
| radial-gradient( circle at 0% 0%, var( --studio-blue-0, #f0f6fc ) 0%, transparent 50% ), | ||
| radial-gradient( circle at 100% 100%, var( --studio-purple-0, #fdf3fc ) 0%, transparent 50% ), | ||
| var( --wpds-color-bg-surface-base, #fff ); | ||
| var( --wpds-color-bg-surface-neutral-strong ); | ||
|
|
||
| @media ( max-width: 900px ) { | ||
| grid-template-columns: 1fr; | ||
|
|
@@ -298,7 +298,7 @@ body.is-section-podcasting { | |
| .podcast__welcome-benefit-icon { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| color: var( --wpds-color-fg-content-neutral, #1e1e1e ); | ||
| color: var( --wpds-color-fg-content-neutral ); | ||
|
|
||
| svg { | ||
| inline-size: 24px; | ||
|
|
@@ -331,7 +331,7 @@ body.is-section-podcasting { | |
| inline-size: 32px; | ||
| block-size: 32px; | ||
| border-radius: 50%; | ||
| background: var( --wpds-color-bg-content-neutral-strong, #2c3338 ); | ||
| background: var( --wpds-color-bg-interactive-neutral-strong ); | ||
|
Contributor
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. Same here — we shoulnd't use |
||
| color: #fff; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
|
|
@@ -349,15 +349,15 @@ body.is-section-podcasting { | |
|
|
||
| .podcast__submit-step { | ||
| padding: 16px; | ||
| background: var( --wpds-color-bg-surface-tertiary, #f6f7f7 ); | ||
| background: var( --wpds-color-bg-surface-neutral-weak ); | ||
| border-radius: 8px; | ||
| } | ||
|
|
||
| .podcast__submit-step-title { | ||
| margin: 0; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| color: var( --wpds-color-fg-content-neutral, #1e1e1e ); | ||
| color: var( --wpds-color-fg-content-neutral ); | ||
| } | ||
|
|
||
| .podcast__submit-step-row { | ||
|
|
@@ -387,14 +387,14 @@ body.is-section-podcasting { | |
| flex: 1; | ||
| min-width: 0; | ||
| padding: 8px 12px; | ||
| background: var( --wpds-color-bg-surface, #fff ); | ||
| border: 1px solid var( --wpds-color-border-neutral, #ddd ); | ||
| background: var( --wpds-color-bg-surface-neutral-strong ); | ||
| border: 1px solid var( --wpds-color-stroke-surface-neutral ); | ||
| border-radius: 4px; | ||
| } | ||
|
|
||
| .podcast__submit-step-saved-icon { | ||
| flex-shrink: 0; | ||
| color: var( --wpds-color-fg-content-success, #007a3d ); | ||
| color: var( --wpds-color-fg-content-success ); | ||
|
|
||
| // Gutenberg's Icon paths use fill="currentColor"; force any stray fill="none" | ||
| // or hard-coded colors to inherit so the success token actually wins. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ | |
| "@swc/core": "^1.11.24", | ||
| "@types/webpack-env": "^1.18.8", | ||
| "@wordpress/browserslist-config": "^6.46.0", | ||
| "@wordpress/theme": "^0.13.0", | ||
|
Contributor
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. Nit: not in alphabetical order |
||
| "@wordpress/dependency-extraction-webpack-plugin": "^6.24.0", | ||
| "autoprefixer": "^10.4.21", | ||
| "babel-loader": "^8.2.3", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| const dsTokenFallbacks = | ||
| require( '@wordpress/theme/postcss-plugins/postcss-ds-token-fallbacks' ).default; | ||
| const autoprefixer = require( 'autoprefixer' ); | ||
| const postcssCustomProperties = require( 'postcss-custom-properties' ); | ||
|
|
||
| /** | ||
| * Returns the PostCSS plugins used across Calypso style builds. | ||
| * | ||
| * @param {Object} options | ||
| * @param {boolean} options.customProperties Whether to include `postcss-custom-properties`. | ||
| * @returns {import('postcss').AcceptedPlugin[]} | ||
| */ | ||
| function getPostCssPlugins( { customProperties = false } = {} ) { | ||
| const plugins = []; | ||
|
|
||
| if ( customProperties ) { | ||
| plugins.push( postcssCustomProperties() ); | ||
| } | ||
|
|
||
| plugins.push( dsTokenFallbacks(), autoprefixer() ); | ||
|
|
||
| return plugins; | ||
| } | ||
|
|
||
| module.exports = { getPostCssPlugins }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,5 @@ | ||
| const { getPostCssPlugins } = require( './postcss-plugins' ); | ||
|
|
||
| module.exports = () => ( { | ||
| plugins: { | ||
| 'postcss-custom-properties': {}, | ||
| autoprefixer: {}, | ||
| }, | ||
| plugins: getPostCssPlugins( { customProperties: true } ), | ||
| } ); |
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.
Same here re.
Textcomponent