Skip to content

Improvements in Webpack overwrites #7984

@mrcasals

Description

@mrcasals

This comes from comments in #7942.

It is outside of these updates but just a small nuance in the docs (it may be because of the GitHub adoc parser):
image

It shows 1. 1. 1. in the numbered list.

Also the instruction for using webpack master would indicate that I have to add npm install https://github.com/rails/webpacker.git to my Gemfile, that could be clarified. I personally understand it but it doesn't mean everyone would.


Also, outside of these changes:

I have not yet tested out the webpacker JS/SCSS overriding in action but this seems odd to me what is written as a comment in the decidim_application.scss which is copied to the instance files:

// This file allows to re-define Decidim CSSs in two ways:
// - to re-define CSS vars, just write them down
// - to re-define whole CSS files, just drop them in app/packs/stylesheets/decidim/...
// (copying the same path they have in Decidim)

If I understand this correctly, it indicates that I could override e.g. the $body-font-family variable here, right?

So, I added this to the decidim_application.scss located within the instance:

// This file allows to re-define Decidim CSSs in two ways:
//   - to re-define CSS vars, just write them down
//   - to re-define whole CSS files, just drop them in app/packs/stylesheets/decidim/...
//     (copying the same path they have in Decidim)

$body-font-family: Consolas, "Liberation Mono", Courier, monospace;

p{
  color: #f00;
}

The text turned to red but the body font did not change. I see that the _decidim-settings.scss has been removed which used to provide us the ability to override the default decidim settings. What we have right now does not really work.

The reason is that this file is included as the last file in decidim-core's application.scss:

@import "stylesheets/decidim/decidim_application";

If we were to override the settings in this file:
https://github.com/decidim/decidim/blob/50654be9c5e8ce5a0033a84b9de6589acfeb9186/decidim-core/app/packs/stylesheets/decidim/utils/_settings.scss

We would have to include the overrides RIGHT AFTER the settings file is loaded here:

@import "stylesheets/decidim/utils/settings";

Otherwise it won't work as it used to.

Another possibility is to add the _decidim-settings.scss back as we used to have in 0.24. I tried the overrides (for both SCSS an JS) as described previously by @ferblape and that actually works (which is great!), so the old convention would still work the same way as it used to if we added it back.

As mentioned, this is not directly related to these documentation changes, this is another issue (but I think an important one).

Originally posted by @ahukkanen in #7942 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions