Skip to content
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

Allow components to be imported with or without dependencies #1797

Closed
36degrees opened this issue May 5, 2020 · 0 comments · Fixed by #1804
Closed

Allow components to be imported with or without dependencies #1797

36degrees opened this issue May 5, 2020 · 0 comments · Fixed by #1804
Assignees
Milestone

Comments

@36degrees
Copy link
Contributor

What

Add a new file called _index.scss to each component, which contains the component’s styles but does not import the settings, helpers and tools layers.

Update the existing _[component].scss files to import the settings, helpers and tools layers and import _index.scss. This will preserve the existing behaviour, and continue to provide a single entry point for individual components that can be used in contexts such as React.

Update components/_all.scss to include every component’s _index.scss file, avoiding the unnecessary imports of the settings, helpers and tools layers within each component.

Why

As proposed in alphagov/govuk-design-system-architecture#22, we’re making changes to the way that the base layers (settings, tools and helpers) are imported within different parts of GOV.UK Frontend’s Sass, to reduce the time it takes to compile to CSS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

1 participant