-
Notifications
You must be signed in to change notification settings - Fork 241
chore: update dependency @spectrum-css/typography to v8.1.0 #5295
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 |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@spectrum-web-components/styles': patch | ||
| --- | ||
|
|
||
| Remove unnecessary system theme references to reduce complexity for components that don't need the additional mapping layer. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,8 +34,6 @@ import '@spectrum-web-components/checkbox/sp-checkbox.js'; | |
| import '@spectrum-web-components/popover/sp-popover.js'; | ||
| import '@spectrum-web-components/divider/sp-divider.js'; | ||
| import cardStyles from './card.css.js'; | ||
| import headingStyles from '@spectrum-web-components/styles/heading.js'; | ||
| import detailStyles from '@spectrum-web-components/styles/detail.js'; | ||
|
|
||
| /** | ||
| * @element sp-card | ||
|
|
@@ -62,7 +60,7 @@ export class Card extends LikeAnchor( | |
| ) | ||
| ) { | ||
| public static override get styles(): CSSResultArray { | ||
| return [headingStyles, detailStyles, cardStyles]; | ||
| return [cardStyles]; | ||
| } | ||
|
|
||
| @property() | ||
|
|
@@ -209,10 +207,7 @@ export class Card extends LikeAnchor( | |
|
|
||
| protected get renderHeading(): TemplateResult { | ||
| return html` | ||
| <div | ||
| class="title spectrum-Heading spectrum-Heading--sizeXS" | ||
| id="heading" | ||
| > | ||
| <div class="title" id="heading"> | ||
| <slot name="heading">${this.heading}</slot> | ||
| </div> | ||
| `; | ||
|
|
@@ -263,7 +258,7 @@ export class Card extends LikeAnchor( | |
|
|
||
| private get renderSubtitleAndDescription(): TemplateResult { | ||
| return html` | ||
| <div class="subtitle spectrum-Detail spectrum-Detail--sizeS"> | ||
| <div class="subtitle"> | ||
|
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. this is where im seeing the issue in VRT
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. @castastrophe looooks so much closer, seems like letter-spacing is the only thing off in the VRTs but I personally like the actual over the baseline. is this an acceptable difference?
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. Yeah I kind of like the updated letter spacing for readability. |
||
| <slot name="subheading">${this.subheading}</slot> | ||
| </div> | ||
| <slot name="description"></slot> | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,15 +116,12 @@ const processCSS = async ( | |
|
|
||
| const processTypography = async ( | ||
| baseSrcPath, | ||
| overridesSrcPath, | ||
|
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. No overrides are needed for the typography package anymore. |
||
| dstPath, | ||
| identifier, | ||
| from, | ||
| usedVariables = undefined | ||
| ) => { | ||
| const baseData = fs.readFileSync(baseSrcPath, 'utf8'); | ||
| const overridesData = fs.readFileSync(overridesSrcPath, 'utf8'); | ||
| const data = baseData + overridesData; | ||
| const data = fs.readFileSync(baseSrcPath, 'utf8'); | ||
| const result = await processCSSData(data, identifier, from, usedVariables); | ||
| fs.writeFileSync(dstPath, result, 'utf8'); | ||
|
|
||
|
|
@@ -214,20 +211,12 @@ async function processSpectrumVars() { | |
| 'typography', | ||
| 'dist' | ||
| ); | ||
| const baseSrcPath = path.join(typographyPath, 'index-base.css'); | ||
| const overridesSrcPath = path.join(typographyPath, 'index-theme.css'); | ||
| const baseSrcPath = path.join(typographyPath, 'index.css'); | ||
| const dstPath = path.resolve( | ||
| path.join(__dirname, '..', 'tools', 'styles', 'typography.css') | ||
| ); | ||
| console.log(`processing typography`); | ||
| processes.push( | ||
| processTypography( | ||
| baseSrcPath, | ||
| overridesSrcPath, | ||
| dstPath, | ||
| 'typography' | ||
| ) | ||
| ); | ||
| processes.push(processTypography(baseSrcPath, dstPath, 'typography')); | ||
| } | ||
|
|
||
| await Promise.all(processes).then(() => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,19 +162,18 @@ async function processComponent(componentPath) { | |
| * @type { import('./spectrum-css-converter').SpectrumCSSConverter} | ||
| */ | ||
| for await (const conversion of conversions) { | ||
| // The default package file is index.css but index-base.css contains the base styles compatible with theme switching. | ||
| let sourcePath = require | ||
| .resolve(conversion.inPackage) | ||
| .replace('index.css', 'index-base.css'); | ||
|
|
||
| // The default package file is index.css | ||
| const sourcePath = require.resolve(conversion.inPackage); | ||
| let sourceCSS = ''; | ||
|
|
||
| // try to find the index-base.css file | ||
| try { | ||
| sourceCSS = fs.readFileSync(sourcePath, 'utf-8'); | ||
| } catch (error) { | ||
|
Comment on lines
-173
to
-175
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. Try catch is not an optimal way to check if a file exists - swapped this for fs.existsSync |
||
| // index-base.css contains the base styles compatible with theme switching | ||
| if (fs.existsSync(sourcePath.replace('index.css', 'index-base.css'))) { | ||
| sourceCSS = fs.readFileSync( | ||
| sourcePath.replace('index.css', 'index-base.css'), | ||
| 'utf-8' | ||
| ); | ||
| } else { | ||
| // if failed, try to find the index.css file | ||
| sourcePath = require.resolve(conversion.inPackage); | ||
| sourceCSS = fs.readFileSync(sourcePath, 'utf-8'); | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,23 +11,7 @@ governing permissions and limitations under the License. | |
| */ | ||
|
|
||
| import baseStyles from './src/spectrum-base.css.js'; | ||
| import langBaseStyles from './src/spectrum-lang.css.js'; | ||
|
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. None of the |
||
| import langOverrides from './src/lang-overrides.css.js'; | ||
| import bodyBaseStyles from './src/spectrum-body.css.js'; | ||
| import bodyOverrides from './src/body-overrides.css.js'; | ||
|
|
||
| import { css } from 'lit'; | ||
|
|
||
| // bodyStyles is a combination of bodyBaseStyles and bodyOverrides | ||
| const bodyStyles = css` | ||
| ${bodyBaseStyles} | ||
| ${bodyOverrides} | ||
| `; | ||
|
|
||
| // langStyles is a combination of langBaseStyles and langOverrides | ||
| const langStyles = css` | ||
| ${langBaseStyles} | ||
| ${langOverrides} | ||
| `; | ||
| import langStyles from './src/spectrum-lang.css.js'; | ||
| import bodyStyles from './src/spectrum-body.css.js'; | ||
|
|
||
| export default [baseStyles, langStyles, bodyStyles]; | ||
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.
This is duplicative - the card styles provide the typography needed for the heading and subtitle sections.