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

Implement scss variables #3530

Merged
merged 29 commits into from
Mar 20, 2017
Merged

Implement scss variables #3530

merged 29 commits into from
Mar 20, 2017

Conversation

juliushaertl
Copy link
Member

@juliushaertl juliushaertl commented Feb 18, 2017

This is a basic implementation for using SCSS variables. For now I only intruduced variables for colors. We can add others for border-radius, etc. later.

fix #2288 #3256 #3211

@skjnldsv @nextcloud/designers Please have a look if it makes sense so far or if anything important is missing.

Applied to files

  • header.scss
  • apps.scss
  • icons.scss
  • inputs.scss
  • multiselect.scss
  • share.scss
  • styles.scss
  • systemtags.scss
  • tooltip.scss

@mention-bot
Copy link

@juliushaertl, thanks for your PR! By analyzing the history of the files in this pull request, we identified @skjnldsv, @ChristophWurst and @rullzer to be potential reviewers.

@skjnldsv
Copy link
Member

This is looking soooo goooood! 💟

@raimund-schluessler
Copy link
Member

Sorry if this is the wrong place, but I haven't found anything in the docs or in the respective issues, so:
Can we also use SCSS for styling apps?

@skjnldsv
Copy link
Member

@raimund-schluessler #3197

@raimund-schluessler
Copy link
Member

Great, thanks, I should have looked in the PRs too.

@MorrisJobke
Copy link
Member

Sorry if this is the wrong place, but I haven't found anything in the docs or in the respective issues, so:
Can we also use SCSS for styling apps?

Good point. @skjnldsv Can you add a note about this in the dev docs?

@@ -114,6 +113,27 @@ private function isCached($fileNameCSS, $fileNameSCSS, ISimpleFolder $folder, $p
}

/**
* Check if the variables file has changed
* @param $fileNameCSS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string? potatoes? ananas? array? ;)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍍 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm now I'm hungry. 😮

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍕

@juliushaertl
Copy link
Member Author

I've now replaced all the colors with temporary variables, so we can better track which color it was before. Next step would be to reduce those values to a basic set of variables:

$color-main-text: #000000;
$color-main-text-dimmed: #555555;
$color-main-background: #ffffff;
$color-main-background-dimmed: #f0f0f0;
$color-primary: #0082c9;
$color-primary-text: #ffffff;
$color-error: #e9322d;
$color-warning: #ffcc44;
$color-success: #46ba61;

I'm not sure how we should handle the simplification of the massive amount of grey values:

$color-main-old-fafafa: #fafafa;
$color-main-old-f8f8f8: #f8f8f8;
$color-main-old-245: rgb(245,245,245);
$color-main-old-f0f0f0: f0f0f0;
$color-main-old-238: rgb(238, 238, 238);
$color-main-old-eeeeee: #eee;
$color-main-old-e8e8e8: #e8e8e8;
$color-main-old-dddddd: #ddd;
$color-main-old-220: rgb(220, 220, 200);
$color-main-old-d3d3d3: #d3d3d3;
$color-main-old-cccccc: #ccc;
$color-main-old-187: rgb(198, 198, 198);
$color-main-old-190: rgb(190, 190, 190);
$color-main-old-bbbbbb: #bbb;
$color-main-old-aaaaaa: #aaa;
$color-main-old-999999: #999;
$color-main-old-150: rgb(150, 150, 150);
$color-main-old-888888: #888;
$color-main-old-777777: #777;
$color-main-old-666666: #666;
$color-main-old-555555: #555;
$color-main-old-222222: #222;
$color-main-old-333333: #333333;

@skjnldsv Using darken/lighten function might be ok, but when it comes to theming (especially themes with inverted colors) using rgba($color-main-text, 0.1) for the different grey variations might be better. What do you think?

@skjnldsv
Copy link
Member

Couldn't we set the darken/lighten functions into the variable.scss file?
So someone can easily edit this?

@skjnldsv
Copy link
Member

For the grey values, we should merge what we have into simpler ones. But this could require to look exactly where they are used since they may be erroneous already. I can see someone putting a #eee right next a #e6e6e6 without seeing what he was doing on the first place :p

$color-main-old-f8f8f8: #f8f8f8;
$color-main-old-245: rgb(245,245,245);
$color-main-old-f0f0f0: f0f0f0;
$color-main-old-238: rgb(238, 238, 238);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #eee

$color-main-old-fafafa: #fafafa;
$color-main-old-f8f8f8: #f8f8f8;
$color-main-old-245: rgb(245,245,245);
$color-main-old-f0f0f0: f0f0f0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing #?

$color-main-old-eeeeee: #eee;
$color-main-old-e8e8e8: #e8e8e8;
$color-main-old-dddddd: #ddd;
$color-main-old-220: rgb(220, 220, 200);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really grey, but slightly green #DCDCC8 - But I can't find any reference in the above code.

$color-main-old-220: rgb(220, 220, 200);
$color-main-old-d3d3d3: #d3d3d3;
$color-main-old-cccccc: #ccc;
$color-main-old-187: rgb(198, 198, 198);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#C6C6C6

$color-main-old-d3d3d3: #d3d3d3;
$color-main-old-cccccc: #ccc;
$color-main-old-187: rgb(198, 198, 198);
$color-main-old-190: rgb(190, 190, 190);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#BEBEBE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐑

$color-main-old-bbbbbb: #bbb;
$color-main-old-aaaaaa: #aaa;
$color-main-old-999999: #999;
$color-main-old-150: rgb(150, 150, 150);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#969696

$color-main-old-666666: #666;
$color-main-old-555555: #555;
$color-main-old-222222: #222;
$color-main-old-333333: #333333;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorted list of grey values:

#222222
#333333
#555555
#666666
#777777
#888888
#969696
#999999
#aaaaaa
#bbbbbb
#bebebe
#c6c6c6
#cccccc
#d3d3d3
#dddddd
#e8e8e8
#eeeeee
#eeeeee
#f0f0f0
#f5f5f5
#f8f8f8
#fafafa

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we in a first step remove similar colours, like those:

bildschirmfoto 2017-02-20 um 12 27 06

Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
…ackground

Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Haertl <jus@bitgrid.net>
@juliushaertl juliushaertl force-pushed the scss-variables branch 2 times, most recently from f9fd812 to 1ebec0d Compare March 20, 2017 12:16
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
@codecov-io
Copy link

Codecov Report

Merging #3530 into master will increase coverage by 0.07%.
The diff coverage is 60%.

@@             Coverage Diff             @@
##             master   #3530      +/-   ##
===========================================
+ Coverage     54.23%   54.3%   +0.07%     
  Complexity    21148   21148              
===========================================
  Files          1304    1304              
  Lines         80779   80782       +3     
  Branches       1282    1282              
===========================================
+ Hits          43810   43869      +59     
+ Misses        36969   36913      -56
Impacted Files Coverage Δ Complexity Δ
lib/private/TemplateLayout.php 0% <0%> (ø) 34 <0> (ø) ⬇️
lib/private/Template/SCSSCacher.php 75.3% <64.28%> (+75.3%) 20 <0> (ø) ⬇️
apps/comments/lib/EventHandler.php 79.16% <0%> (-8.34%) 7% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 450a899...a0f7d4b. Read the comment docs.

@juliushaertl
Copy link
Member Author

@MorrisJobke @LukasReschke @skjnldsv @nextcloud/designers Ready for review.

We can squash those commits, but I think it might be easier to trace what has changed exactly for reviewing.

@juliushaertl juliushaertl added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Mar 20, 2017
Copy link
Member

@MorrisJobke MorrisJobke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works nicely 👍

Copy link
Member

@LukasReschke LukasReschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nicely :)

@LukasReschke LukasReschke merged commit 21cf1b2 into master Mar 20, 2017
@LukasReschke LukasReschke deleted the scss-variables branch March 20, 2017 18:49
@MorrisJobke
Copy link
Member

🎉 Thanks a lot @juliushaertl

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

Successfully merging this pull request may close these issues.

Change themed CSS generation to SCSS templates
7 participants