intoli / antd-scss-theme-plugin

A Webpack plugin for customizing Ant Design with an SCSS theme file and using Ant Design's compiled variables in SCSS files throughout your project.
https://intoli.com/blog/antd-scss-theme-plugin/
Other
201 stars 81 forks source link

Import of another scss is not working #52

Open nettiopsu opened 5 years ago

nettiopsu commented 5 years ago

Hello!

I am trying to import another scss file with partials into theme.scss. It seems this is not supported?

Use case: There are multiple websites under the same brand. They share same logo, fonts and so on. However, parameters like website colors can vary from site to site, since they have different content

I would like to have a theme file with same basics: fonts, sizes, line heights and so on, which differ from standard

I want to be able to extend this theme with other colors and some other parameters.

This plugin returns me this errors for import at the moment:

Could not compile the SCSS theme file "./theme.scss" for the purpose of variable extraction. This is likely because it contains a Sass error.

Error: Invalid CSS after "...test { content:": expected expression (e.g. 1px, bold), was \'@import "../src/bas\'\n on line 1 of stdin\n>> .test { content: @import "../src/base-theme.scss" }

theme.scss:

@import "../src/base-theme.scss";
$primary-color: yellow;

Is there some workaround for it?

nettiopsu commented 5 years ago

It seems that it is supported in scss-to-json library (which is used in this project) as "dependencies" parameter: https://github.com/ryanbahniuk/scss-to-json

vrsotto commented 4 years ago

@nettiopsu hi! we're you able to solve this issue? i hope you could share your solution

mazeeblanke commented 4 years ago

any update on this ?

vrsotto commented 4 years ago

I followed this https://dailyjsx.com/antd-rescript-sass-boilerplate -- and address my problem in https://github.com/nadunindunil/antd-rescripts-boilerplate/issues/1

mrszympek commented 4 years ago

Same problem here 🙋🏻‍♂️ Any solution?