typography/property-disallowed-list
Disallows declarations of text style properties.
Use Polaris text component instead of custom styles so that typography is consistent across the Admin. This helps merchants have a coherent user experience and also ensures that typography is in sync with the design system.
Example
// Do
+ <Text variant="headingXs" as="p" />
// Don't
- font-size: var(--p-font-size-300);
- font-weight: var(--p-font-weight-semibold);
- line-height: var(--p-font-line-height-400);
- letter-spacing: var(--p-font-letter-spacing-normal);
Contribute
Have you found that merchants benefit from styles or components that aren't in Polaris? We'd love to learn more. You can jumpstart a contribution to Polaris in GitHub by:
- Starting a discussion to collaborate with the community to find a solution
- Submitting a feature proposal issue to share context on your suggestion
- Drafting a pull request with your proposed improvement or addition
Ignore failure
If styles are intentionally designed to diverge from Polaris and it isn't viable to contribute back to the design system, you can ignore the failing rule. Make sure to provide context as to why you are writing custom styles with a disable description.
Example
// stylelint-disable-next-line -- why custom styles are being used instead of Polaris