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

USWDS - Feature: Support Sass pkg NodePackageImporter entrypoints #5850

Open
2 tasks done
aduth opened this issue Apr 3, 2024 · 0 comments
Open
2 tasks done

USWDS - Feature: Support Sass pkg NodePackageImporter entrypoints #5850

aduth opened this issue Apr 3, 2024 · 0 comments
Labels
Status: Triage We're triaging this issue and grooming if necessary Type: Feature Request New functionality

Comments

@aduth
Copy link
Contributor

aduth commented Apr 3, 2024

Is your feature request related to a problem? Please describe.

Currently, USWDS requires specific configuration of Sass compilation options, which is a barrier to entry and potential stumbling point for using the design system.

Describe the solution you'd like

Recently, Sass introduced a new feature to use a pkg: prefix to support the common use-case of importing Node packages into a project, which could avoid the need for modifying load paths to use stylesheets from third-party libraries.

Example expected usage:

# Before:
@use "uswds-core";
@forward "usa-accordion";

# After
@use "pkg:@uswds/uswds/uswds-core";
@forward "pkg:@uswds/uswds/usa-accordion";

# Alternatively, removing redundant prefixes, using custom entrypoint names differing from folder names:
@use "pkg:@uswds/uswds/core";
@forward "pkg:@uswds/uswds/accordion";

At the very least, it would be reasonable to support this as a supported option by adding the sass entrypoints to package.json to support the behavior for those who want it as an alternative to load_paths. This doesn't need to be a breaking change.

It's worth noting that this does require that the project include NodePackageImporter as an importer (documented in the announcement post), so it doesn't entirely get away from Sass compilation options requirements. But it might be reasonable to expect that NodePackageImporter could exist as a default or existing option in some projects, and therefore not require additional configuration specific to USWDS.

Code of Conduct

@aduth aduth added the Type: Feature Request New functionality label Apr 3, 2024
@github-actions github-actions bot added the Status: Triage We're triaging this issue and grooming if necessary label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage We're triaging this issue and grooming if necessary Type: Feature Request New functionality
Projects
Status: No status
Development

No branches or pull requests

1 participant