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

Theming: invert foreground color on bright backgrounds #412

Merged
merged 4 commits into from
Jul 18, 2016

Conversation

juliusknorr
Copy link
Member

As discussed in #378, this pull request extends the theming app to invert the text/icon color inside
the header for bright colors.

Algorithm for luminance calculation: https://www.w3.org/TR/AERT#color-contrast

Before:
2016-07-14-211653_960x529_scrot
After:
2016-07-14-211612_960x529_scrot

By now the Nextcloud logo will not be touched, as specified by the Nextcloud Trademark Guidelines:

The logo is light blue with black text on white. It should not be used differently, especially not inverted. The name "Nextcloud" can be optionally left out though, we provide logo's without the text.

cc @nextcloud/designers @schiessle

@mention-bot
Copy link

@juliushaertl, thanks for your PR! By analyzing the annotation information on this pull request, we identified @LukasReschke, @oparoz and @Henni to be potential reviewers

function calculateLuminance(rgb) {
var hexValue = rgb.replace(/[^0-9A-Fa-f]/,'');
var r,g,b;
if(hexValue.length === 3) {
Copy link
Member

Choose a reason for hiding this comment

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

Missing space between if and (.
But it would be worth parsing the whole code so that all such errors are automatically fixed.

@oparoz
Copy link
Member

oparoz commented Jul 15, 2016

Looks good. The logo part can be taken care of in another PR, simply detect if a custom one is used and if there is a dark version.

I'm not a fan of static methods, but everything seems tested, so it's not a show stopper.

@juliusknorr
Copy link
Member Author

All right, thanks. Spaces should be fixed now.

@jancborchardt jancborchardt added enhancement design Design, UI, UX, etc. labels Jul 15, 2016
@jancborchardt
Copy link
Member

Wow, awesome! :) Really good stuff @juliushaertl

@nextcloud/designers @Lord-Protector @schiessle let’s give this a good test! Also with the installation process etc.

@juliushaertl @oparoz the logo we will leave entirely untouched, yes. Because when you change the theming, you will see that a light logo will not work. That’s not something we should automatically modify.

@schiessle
Copy link
Member

schiessle commented Jul 15, 2016

  • If I change the color the arrow next to drop down menu disappears, otherwise great work @juliushaertl !

@schiessle
Copy link
Member

The JavaScript console shows this error:

http://localhost/core/img/actions/caret.svg 404 (Not Found)

the correct path would be http://localhost/master/core/img/actions/caret.svg

@oparoz
Copy link
Member

oparoz commented Jul 15, 2016

Good point @jancborchardt.

@savely-krasovsky
Copy link

savely-krasovsky commented Jul 15, 2016

@jancborchardt theoretically logo will have a good look with some shade of gray.
But it requires study.

@juliusknorr
Copy link
Member Author

The disappearing icon should be fixed now.
@schiessle

@schiessle
Copy link
Member

everything works now... Great work! 👍

@nickvergessen
Copy link
Member

Works and looks good 👍

Regarding:

By now the Nextcloud logo will not be touched, as specified by the Nextcloud Trademark Guidelines:

The logo is light blue with black text on white. It should not be used differently, especially not inverted. The name "Nextcloud" can be optionally left out though, we provide logo's without the text.

Not sure about this, maybe @karlitschek can help, because in this case the logo was already recolored (it's white not light-blue)

@nickvergessen nickvergessen merged commit 89a32a2 into master Jul 18, 2016
@nickvergessen nickvergessen deleted the theming-foreground-color branch July 18, 2016 10:43
@nickvergessen
Copy link
Member

@juliushaertl want to make a PR against stable9 as well?

@nickvergessen nickvergessen added this to the Nextcloud Next milestone Jul 18, 2016
@schiessle
Copy link
Member

Not sure if we should backport it... It is not a critical bug. I would prefer to keep it for the next release

@karlitschek
Copy link
Member

True. @jospoortvliet We should update our trademark policy to also allow white on blue.

@jancborchardt
Copy link
Member

@karlitschek theming has nothing to do with the trademark policy though I would say. When theming your Nextcloud, you should also use a different logo. :)

@karlitschek
Copy link
Member

true :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews design Design, UI, UX, etc. enhancement feature: theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants