Skip to content

Incomplete typography documentation #1552

@davidkudera

Description

@davidkudera

Expected Behaviour

There is a note that typography.css file provides lit-html compliant version of the Spectrum Typography classes which I actually can't use directly in Lit. But it's also possible that I just don't understand the docs correctly.

I think that the documentation should include info about the .js files from styles directory that can be used in Lit

We're using the following in our components:

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,
	];
}

The order of styles is also important. typography.js must go after the other Spectrum styles otherwise, for example, headings will have margin: 0.

Actual Behaviour

There is no typography code sample in docs that I can use with LitElement.

Platform and Version

  • Windows 10
  • Chrome 91.0.4472.106
  • Webpack 5.38.1
  • Spectrum web components 0.22.1-alpha.2

Metadata

Metadata

Assignees

Labels

Component: DocumentationIssues or PRs involving changes to docs or docs website. Component prefix is for Jira integration.Component: StylesNeeds discussionProposed UX or spec changes requiring discussion w/ internal teamjira ticket createdTODO: Delete label once Jira integration is complete

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions