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

Reorganize less variables for simpler theming #7876

Closed
mnapoli opened this issue May 10, 2015 · 9 comments
Closed

Reorganize less variables for simpler theming #7876

mnapoli opened this issue May 10, 2015 · 9 comments
Assignees
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@mnapoli
Copy link
Contributor

mnapoli commented May 10, 2015

Following a discussion in #7793 we want to expose a simple less file containing the base variables that themes can override. Those variables will be considered as API (no BC-break).

We still want to be able to create other less variables (for practical purposes) so we will put these other variables in a separate file, and those variables will not be API.

@mnapoli mnapoli added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label May 10, 2015
@mnapoli mnapoli self-assigned this May 10, 2015
@mnapoli mnapoli added this to the 2.14.0 milestone May 10, 2015
@mnapoli
Copy link
Contributor Author

mnapoli commented May 10, 2015

FYI this needs to be done after most of the "redesign" pull requests are merged to avoid any conflict.

@tsteur
Copy link
Member

tsteur commented May 10, 2015

Just to clarify. In this issue can we move @theme-color-background and @theme-color-code-background to the not API file and let the colours default to @color-silver-l30 and @color-silver-l95? Or remove the new variables and replace @theme-color-background with @color-silver-l30 and @theme-color-code-background with @color-silver-l95 (that's how we usually do it currently, but can be changed if needed)

@mnapoli
Copy link
Contributor Author

mnapoli commented May 10, 2015

Did you mean @theme-color-code instead of @theme-color-background in your comment? @theme-color-background is themable right?

@tsteur
Copy link
Member

tsteur commented May 10, 2015

I meant where we currently use that variable in a less file instead of

color: @theme-color-code-background

we could use

color: @color-silver-l95

and remove the code less variable. That's how it's usually done currently in several places.

Alternatively we could at least do

@theme-color-code-background: @color-silver-l95

Same with the other variable.

Different topic but can be maybe done in this issue as well: In general I would only put those variables in the basic.less or simple.less or whatever:

@theme-fontFamily-base: Verdana, sans-serif;
@theme-color-brand:                    @color-red-piwik;
@theme-color-brand-contrast:           @color-white;
@theme-color-text:                     @color-black-piwik;
@theme-color-text-light:               #444;
@theme-color-text-lighter:             @color-silver-l40;
@theme-color-link:                     @color-blue-piwik;

@theme-color-menu-contrast-text: @theme-color-text-lighter;
@theme-color-menu-contrast-textActive: @theme-color-text;
@theme-color-menu-contrast-background: @theme-color-background-tinyContrast;
@theme-color-widget-title-text: @theme-color-text;
@theme-color-widget-title-background: @theme-color-background-tinyContrast;

This will make it much easier and less frustrating for plugin developers since those variables don't really impact other things that one need to change.
Eg I would remove all the background color variables in general (or move it to advanced.less). Once one starts to change the background color one kinda has to change so many other things to not make it look weird. It's a lot of work and quite hard. For example theming the background color and colors of the Map and some graphs become very hard, icons still have a white background (refs #7618). Meaning if we don't allow to change background color or put it in advanced, needing to change the code thing is basically not needed.

@mnapoli
Copy link
Contributor Author

mnapoli commented May 10, 2015

But the background color is the only thing we know is customized (the two currently published themes). If we speak only of what we know, then removing it wouldn't be such a good idea.

@tsteur
Copy link
Member

tsteur commented May 11, 2015

It'd put it in a advanced.less or so. Most companies that use theming do very likely not change the background color but only adjust like the widget header, brand color, link color and maybe menu color to their CI. Such themes won't be public in the marketplace.

This will make it easier for developers to get started since they will have only a few options and those are easy and one shouldn't get frustrated with those as they are straight forward. Knowing that eg background-color is in eg a advanced.less will maybe developers make clear there will be more work and it won't be easy etc. Just an idea...

@mnapoli
Copy link
Contributor Author

mnapoli commented May 11, 2015

OK makes sense.

@mnapoli mnapoli added the c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. label May 20, 2015
@mnapoli
Copy link
Contributor Author

mnapoli commented May 20, 2015

PR: #7951

@mnapoli
Copy link
Contributor Author

mnapoli commented May 28, 2015

Developer documentation updated.

@mnapoli mnapoli closed this as completed May 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

2 participants