-
Notifications
You must be signed in to change notification settings - Fork 486
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
Duplicate resulting CSS #1274
Comments
/cc @gretaaaa which found the issue and helped me debug the problem. |
Fixes #1274 - Duplicate CSS in Liferay DXP 7.1
Sorry if we didn’t provide a PR. Thanks for solving it. |
Now that I see that PR, why did you squash all imports into the entrypoints!? |
Oh! My wording was terrible now that I think of it! Sorry for the confusion. In my personal opinion all three entry points should use this:
That way all of them have the same exact behavior, without requiring any duplication. In a SCSS they would be symlinks. |
@yuchi, you make a good point. The reason I didn't do it that way was because I'm unable to modify the Bootstrap source files and we will need to for #1270. There's some magic that happens when we build the Clay project that resets any changes made. I suppose I could have made a separate file and have all the entry points use that file instead. We could also change the build task to use the Bootstrap source from clay-css instead of npm. |
Wait. I’m talking about this bootstrap.scss. There’s no need to change Bootstrap sources, I’m talking about your main entry points (namely |
@yuchi, Right I was also referring to those files. I went off on a tangent regarding compile errors with variable resets using Ruby/Dart Sass. The solution for #1270 I had in mind was way too complicated and decided to scrap the idea. We can change the imports on
|
IMHO it’s clearer and less obtrusive approach. Just my 2¢ anyway. |
Looks like you are using two different ways to import Bootstrap SCSS in your main entry points (
base
,atlas
,bootstrap
).In
bootstrap.scss
you load it as:In
atlas.scss
andbase.scss
you load it as:This means that
atlas.scss
andbase.scss
are not loading Bootstrap directly, but pass throughbootstrap.scss
which in turn actually loads Bootstrap for them.This approach has no issues here on Clay CSS repo, where
bootstrap.scss
has no content outside the import.In contrast, in Liferay DXP themes those files have their
// INSERT …
comments replaced with imports to the theme custom variables and extensions. This means that if the theme is usingatlast
orbase
they will get the following structure (indentation artificially added to make imports clearer):You can easily see how this produces duplicate CSS in the final output.
Proposal (PR coming soon)
All three entrypoints should load Bootstrap in the way
bootstrap.scss
is doing.The text was updated successfully, but these errors were encountered: