Skip to content

Commit

Permalink
Adding note in README about url() path limitation
Browse files Browse the repository at this point in the history
  • Loading branch information
weaverryan committed Aug 18, 2023
1 parent 8954514 commit 26774e8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,34 @@ php bin/console sass:build
php bin/console asset-map:compile
```

## Limitation: url() Relative Paths

When using `url()` inside a Sass file, currently, the path must be relative to
the *root* `.scss` file. For example, suppose the root `.scss` file is:

```scss
/* assets/styles/app.scss */
import 'tools/base';
```

Assume there is an `assets/images/login-bg.png` file that you want to refer
to from `base.css`:

```scss
/* assets/styles/tools/base.scss */
.splash {
/* This SHOULD work, but doesn't */
background-image: url('../../images/login-bg.png');

/* This DOES work: it's relative to app.scss */
background-image: url('../images/login-bg.png');
}
```

It should be possible to use `url()` with a path relative to the current file.
However, that is not currently possible. See [this issue](https://github.com/SymfonyCasts/sass-bundle/issues/2)
for more details.

## Configuration

To see the full config from this bundle, run:
Expand Down

0 comments on commit 26774e8

Please sign in to comment.