Skip to content
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

Use Sass instead of PHP to compile CSS #14633

Merged
merged 9 commits into from Nov 15, 2018

Conversation

MauricioFauth
Copy link
Member

Description

I propose to use the Sass language instead of PHP for CSS.
Since Sass is an extension of CSS, I think it brings more benefits when doing CSS maintenance.
The downside is that scss files need to be compiled to CSS.

node_modules/.bin/sass themes/pmahomme/scss:themes/pmahomme/css
node_modules/.bin/sass themes/original/scss:themes/original/css
node_modules/.bin/sass themes/metro/scss:themes/metro/css

@codecov
Copy link

codecov bot commented Sep 27, 2018

Codecov Report

Merging #14633 into master will increase coverage by 0.93%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##             master   #14633      +/-   ##
============================================
+ Coverage        50%   50.94%   +0.93%     
+ Complexity    14005    13991      -14     
============================================
  Files           498      473      -25     
  Lines         66651    65304    -1347     
============================================
- Hits          33329    33268      -61     
+ Misses        33322    32036    -1286

@ibennetch
Copy link
Member

I remember having looked at Sass before (perhaps even for some other project) but don't really know much about it. I don't have any strong feeling about this right now either way. How will it help us maintain the CSS? Can it easily work with the new theme generator?

@MauricioFauth
Copy link
Member Author

How will it help us maintain the CSS?

For now I just ported the files to scss, so it has no obvious advantages. However, in addition to being a well-known language, which makes it easier for new contributors, Sass has a nesting feature that facilitates the organization and reading of CSS, another interesting feature is the mixins, which are a kind of function, besides supporting the variables, operators and inheritance. Another advantage is the theme does not contain any PHP file, which increases security for third party themes.

Can it easily work with the new theme generator?

Yes. Instead of generating .css.php files, the generator can generate .scss files. The generator can also benefit from the Sass import feature.

@MauricioFauth MauricioFauth changed the title [RFC] Use Sass instead of PHP to compile CSS Use Sass instead of PHP to compile CSS Oct 19, 2018
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Loads theme.css directly

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
[ci skip]

Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
@williamdes
Copy link
Member

@MauricioFauth Can you add the following paths to .gitignore
themes/pmahomme/css/*.css
themes/original/css/*.css
themes/metro/css/*.css
package-lock.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants