Update readme to improve customization instructions #208
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This project's documentation is pretty sloppy. This PR goes a short way to improving it, but there's much farther to go. The general gist of these changes is that there a single directory for stylesheet-based customization:
/_sass
. This directory uses two critical files:_uswds-theme-settings.scss
: The entry point for USWDS settings._uswds-theme-custom-styles.scss
: The entry point for new project Sass, overrides, etc.uswds-theme-settings.scss
USWDS settings control the design system output. Use settings to assign your theme colors, typefaces, type scale, and component styling (among other things). All the settings available to the design system are documented in the Settings section of USWDS website. In uswds-jekyll, we suggest including only the settings variables you wish to change/override in the settings entry point, like:
You could also use the older USWDS approach and just grab all the available settings (in separate files) from https://github.com/uswds/uswds/tree/develop/src/stylesheets/theme, add each of these files to the
/_sass
directory, edit them individually, and then@import
them all from the settings entry point. For instance, if you added all the USWDS theme files to/_sass/settings
, you could then reference them in the entry point:But this approach can introduce errors into version-to-version updates, which is why we suggest the earlier approach.
In general, settings control the USWDS CSS. To add additional CSS or to override the design system beyond what settings allow, you need custom Sass.
uswds-theme-custom-styles.scss
Add any custom Sass or overrides into the custom styles entry point, or, like shown above, use the entry point to import multiple Sass files. All USWDS design tokens, as well as functions and mixins are available to this file or any file imported from it, so you can add USWDS-flavored Sass like:
And, as above, you could use the entry point to import multiple custom style files if you added those files to the
/_sass
directory. For instance, if you added custom style files to/_sass/my-styles
, you could then reference them in the entry point: