uswds / uswds-compile

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

USWDS-Compile - Bug: Incorrect relative image paths in compiled styles #81

Closed gudatcomputers closed 9 months ago

gudatcomputers commented 9 months ago

Describe the bug

Running uswds-compile with a customuswds.paths.src.theme setting produces a styles.css with invalid path values for background-image

Running uswds-compile without a custom uswds.paths.src.theme settings produces the expected result

Steps to reproduce the bug

uswds.settings.version = 3; uswds.paths.src.theme = "src/theme"; uswds.paths.dist.theme = "src/theme"; exports.init = uswds.init; exports.compile = uswds.compile;

- run `gulp init`
- look at output in `/assets`, the directory structure is 

assets | uswds | css | fonts | img |__ js



the file at `assets/uswds/css/styles.css` sets `background-image` values with paths like `url(../uswds/img/usa-icons/launch.svg);` which is an incorrect relative URL.  The url set for fonts is the correct relative URL

### Expected Behavior

the output at `/assets/uswds/css/styles.css` uses relative paths like `url(../img/usa-icons/launch.svg);`

### Related code

_No response_

### Screenshots

<img width="344" alt="Screenshot 2023-11-22 at 10 05 36 AM" src="https://github.com/uswds/uswds-compile/assets/5578187/33ac9333-4858-45ab-bc5f-e9cb49e6be31">
<img width="669" alt="Screenshot 2023-11-22 at 10 05 44 AM" src="https://github.com/uswds/uswds-compile/assets/5578187/13b9a6e1-aae7-4e14-a967-6a19d03d2f7a">
<img width="912" alt="Screenshot 2023-11-22 at 10 40 50 AM" src="https://github.com/uswds/uswds-compile/assets/5578187/d0898b77-b3a9-44ba-991b-db1d1859ee5e">

### System setup

`@uswds/compile - 1.0.0`
`@uswds/uswds - 3.7.0`
MacOS

### Additional context

_No response_

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://designsystem.digital.gov/about/community/#community-conduct).
- [X] I checked the [current issues](https://github.com/uswds/uswds-compile/issues) for duplicate bug reports.
gudatcomputers commented 9 months ago

abandoning uswds-compile here... the issue doesn't seem related as we were able to repro this with the standalone sass npm package

mejiaj commented 9 months ago

Thanks for the update @gudatcomputers