Skip to content

Commit

Permalink
docs: add style include paths docs
Browse files Browse the repository at this point in the history
This feature was introduce in #4003 but never documented.
  • Loading branch information
filipesilva authored and hansl committed Mar 13, 2017
1 parent 7461528 commit 5b1668f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions docs/documentation/stories/global-styles.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,27 @@ You can also rename the output and lazy load it by using the object format:
{ "input": "pre-rename-style.scss", "output": "renamed-style" },
],
```

In Sass and Stylus you can also make use of the `includePaths` functionality for both component and
global styles, which allows you to add extra base paths that will be checked for imports.

To add paths, use the `stylePreprocessorOptions` entry in angular-cli.json `app` object:

```
"stylePreprocessorOptions": {
"includePaths": [
"style-paths"
]
},
```

Files in that folder, e.g. `src/style-paths/_variables.scss`, can be imported from anywhere in your
project without the need for a relative path:

```
// src/app/app.component.scss
// A relative path works
@import '../style-paths/variables';
// But now this works as well
@import 'variables';
```

0 comments on commit 5b1668f

Please sign in to comment.