Skip to content

How to import specific styles package into component? #1694

Answered by Westbrook
mahdiridho asked this question in Q&A
Discussion options

You must be logged in to vote

Which CSS are you trying to leverage here?

As outlined here: #1552 we do offer a number of helper sheets that can be imported into a component for use in delivering text content. Those sheets can be imported as follows:

import spectrumHeadingStyles from '@spectrum-web-components/styles/heading.js';
import spectrumBodyStyles from '@spectrum-web-components/styles/body.js';
import spectrumTypographyStyles from '@spectrum-web-components/styles/typography.js';

@customElement('my-component')
class MyComponent extends LitElement
{
	public static styles: CSSResultGroup = [
		...spectrumHeadingStyles,
		...spectrumBodyStyles,
		...spectrumTypographyStyles,
	];
}

While, as the above issue outline…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mahdiridho
Comment options

Answer selected by Westbrook
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants