You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.
When generating the compiled css files, ( ie both blocks.editor.build.css and blocks.style.build.css )... the compiler seems to include the common.scss file, once for every single block that is added.
this results in gigantic files, the more blocks you have
to reproduce....
create a fresh install of CGB
duplicate the /src/block/ folder a couple times, so there are block2, block3 folders, etc
optional.. modify each block's style.scss to make sure each block's css gets pulled in once, (it does)
run compiler, and check the compiled css in dist/*.css
example output of blocks.style.build.css
notice how the individual block's style.scss files are included once (which is expected).... but for EVERY block, the common.scss file is included AGAIN, instead of just ONCE overall
* #.# Common SCSS
*
* Can include things like variables and mixins
* that are used across the project.
..... this css is from the common.scss file, which gets included multiple times if there are multiple blocks loaded/compiled together
*/
body {
background-color: white; }
/**
* 11111
*/
.my-block1 {
color: red; }
/**
* #.# Common SCSS
*
* Can include things like variables and mixins
* that are used across the project.
..... this css is from the common.scss file, which gets included multiple times if there are multiple blocks loaded/compiled together
*/
body {
background-color: white; }
/**
* 22222
*/
.my-block2 {
color: blue; }
/**
* #.# Common SCSS
*
* Can include things like variables and mixins
* that are used across the project.
..... this css is from the common.scss file, which gets included multiple times if there are multiple blocks loaded/compiled together
*/
body {
background-color: white; }
/**
* 3333333
*/
.my-block3 {
color: green; }
here is the example ive created above: my-block.zip
The text was updated successfully, but these errors were encountered:
In the styles directory include file editor.scss (styles for backend editor), style.scss (styles for frontend+backend editor), index.js (only include import scss file).
Then import blocks.js file like a normal block
Now in the file common.scss should only leave variables, mixins. All styles in common.scss file should be moved into styles/style.scss file. You can override styles in the backend editor by writing styles/editor.scss file.
It's done!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When generating the compiled css files, ( ie both
blocks.editor.build.css
andblocks.style.build.css
)... the compiler seems to include thecommon.scss
file, once for every single block that is added.this results in gigantic files, the more blocks you have
to reproduce....
block2
,block3
folders, etcblocks.js
file as usual like sodist/*.css
example output of
blocks.style.build.css
notice how the individual block's style.scss files are included once (which is expected).... but for EVERY block, the common.scss file is included AGAIN, instead of just ONCE overall
here is the example ive created above:
my-block.zip
The text was updated successfully, but these errors were encountered: