Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow theme subfolders #3442

Merged
merged 1 commit into from
Aug 6, 2023
Merged

Conversation

t-fritsch
Copy link
Collaborator

allows custom themes to import files from subfolders inside the css/theme/source folder.

in css/theme/source/custom-theme.scss we can now do

@import `custom-theme/controls`;
@import `custom-theme/headings`;
...

This is usefull when creating custom themes with lot of features to split sass rules in different scss files.

Also, passing file parameter to sass.render() makes @import instructions work without the need to specify includePaths (that is a hack sometimes used when working only with the data parameter since sass doesn't know where the file is and then cannot do relative imports).

As stated in https://sass-lang.com/documentation/js-api/interfaces/legacystringoptions/#file :

If file and data are both passed, file is used as the path of the stylesheet for error reporting, but data is used as the contents of the stylesheet.

Since sass now knows where each file is, it can do relative @import without trouble.

allows custom themes to import files from subfolders inside the `css/theme/source` folder.

in `css/theme/source/custom-theme.scss` we can now do
```scss
@import `custom-theme/controls`
@import `custom-theme/headings`
...
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants