-
Notifications
You must be signed in to change notification settings - Fork 1
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
Switch SASS to Dart SASS #18
Conversation
To allow task splitting.
Keeps components partial update as style files are added and removed.
In order to compile component styles.
Needs to be its own partial in order to output correctly.
Applicable to admin styles.
Making use of @use.
Added other necessary updates.
Removes unused packages.
To be used for the example site.
these dependencies are no longer needed.
Rather than the whole package.
Can be enabled through .env
Following error occurs when watching for changes.
Also the following appears on the frontend (see attached image). What I did
|
Could throw an error if it is.
@arrontp try to run However, this error seems to have to do with the program not handling empty directories when looking for files. I couldn't replicate the error but I've added a check for this and pushed to this branch. As for the Let me know if this sorts it out. 🙏 |
Interesting, I can't seem to replicate this error after doing a setup from scratch:
The version of PHP I'm using is:
|
Slightly mnore friendly to Docker setups.
Empty array kept file from being updated.
@arrontp solved the issue with |
I've merged into #21 to be able to test Docker setups, we can continue this discussion there. |
Changes:
gulp-sass
@import
statements into@use
or@forward
as recommended in the Sass documentation.abstracts/
directory and a_components.scss
and_blocks.scss
to include component styles while keeping component folder structure.temp.scss
to be created. Now they get forwarded from_components.scss
._components.scss
and_blocks.scss
will be automatically updated.No longer required to manage font paths
In previous version of Hozokit there was a dedicated
set-font-path
mixin to set the correct path for local hosted fonts both on the theme side and the admin side:This meant that changing or adding new fonts required the mixin to be updated. This was slightly simplified:
The font path is now a variable with a default value, meaning it can be changed to a different path for the admin panel:
This simplifies the code behind setting up hosted fonts and what needs to be removed as well in cases where Adobe or Google Fonts are used via a URL instead.
Changes in how styles are structured
Sass version was changed to use Dart Sass which required all
@import
statements to be deprecated and replaced with either@use
or@forward
, depending on the use case. The@import
functionality is being deprecated in future versions of Sass.In previous version styles and partials would be all directly stored in
styles/
and components and block each could have their ownstyle.scss
which would then get merged during bundling to create a finalstyle.scss
:In the current version, variables, mixins, fonts and other utilities are now stored in
abstracts/
. A_components.scss
and_blocks.scss
was introduced too (more on this below) and the required comment that defines theme metadata has been moved to its own partial to make sure it prints at the top of the stylesheet:This organises files slightly differently but allow for flexibility when access abstracts:
Component and block list partials
As a result of implementing the
@use
and@forward
syntax, components now are forwarded to a_components.scss
and blocks to_blocks.scss
, respectively. This allows for the compile task to be simplified and not rely on the concatenation of all components to a_temp.scss
:I expect this file to (in most cases) be free from manual edits. As component
style.scss
are added, renamed and removed thecomponentForwarding
task manages the file automatically. Same for any block specific styles as well.