uswds / uswds-compile

Simple Gulp 5 functions for copying USWDS static assets and transforming USWDS Sass into browser-readable CSS.
Other
20 stars 12 forks source link

Icons: allow for custom directory #31

Closed mejiaj closed 2 years ago

mejiaj commented 2 years ago

Description

Allow custom icons directory. You can now pass an optional directory to compile icons. Additionally, you can choose to only watch this newly defined directory. The default behavior is to combine it with usa-icons. Closes #30.

    flowchart TD;
    usa-icons--Default-->A[usa-icons only]
    usa-icons-->uswds.paths.dist.icons-->custom_sprites_only-->Yes & No
    Yes-->B[Custom only]
    No--Default-->C[Combined]

💡Flow chart is made in markdown - see GH Docs.

How to test

Test branch on Site with instructions available in https://github.com/uswds/uswds-site/pull/1614

thisisdano commented 2 years ago

Great work! This is really useful and works as expected. As we discussed, I've made a couple updates here for more consistency with the existing API:

  1. paths.dist.icons → paths.src.projectIcons: This is a src destination, since it's a source for the icon sprite. The new name mirrors paths.src.projectIcons, which is a location for additional project Sass.
  2. custom_sprites_only → sprite.projectIconsOnly: Camel-case naming is more consistent with our current naming conventions, and adding it to sprite keeps the icon sprite options together. projectIconsOnly connects to projectIcons so these options are related.
  3. Export settings.sprite so users can modify it like the paths object.
  4. Add documentation