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

New design for code blocks #7793

Merged
merged 1 commit into from May 10, 2015
Merged

New design for code blocks #7793

merged 1 commit into from May 10, 2015

Conversation

mnapoli
Copy link
Contributor

@mnapoli mnapoli commented Apr 30, 2015

Related to #7585

Applied the new <code> and <pre> design (which is in #7450 or #7584 or #7587 too) and made it consistent everywhere. I was able to removed every custom CSS/Less for these tags which is quite great!

It was also the occasion to fix <code> which was used for code blocks: it's an inline tag, <pre> should used for code blocks instead. I changed templates where it was used as a block and replaced it with <pre>.

Below are screenshots of the new UI demo introduced in #7787.

Before

capture d ecran 2015-04-30 a 16 40 12

After

capture d ecran 2015-04-30 a 16 39 52

@mnapoli mnapoli added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Design / UI For issues that impact Matomo's user interface or the design overall. Needs Review PRs that need a code review labels Apr 30, 2015
@mnapoli mnapoli added this to the Piwik 2.14.0 milestone Apr 30, 2015
@mattab
Copy link
Member

mattab commented Apr 30, 2015

Looks good to me

@tsteur
Copy link
Member

tsteur commented Apr 30, 2015

If we do add this to the demo page, we make this (the code block and the less variables) basically a public API. This means it should be documented in the developer changelog and we need to support it in the future. This also has affects on what we allow to theme.

I'm not sure if other plugin developers will need the code tag? Maybe it would be worth having a page for core developers and one for plugin developers? The code tag seems to be rather interesting for core developers but less for plugin developers. Just trying to keep things for plugin developers simple and easy by not having too many things there. If we decide to expose the less variables (which is currently the case in this PR as it is in _variables.less), it might be actually nice to have the code block on the page for plugin developers for easier theming.

I'm not sure re exposing the less variables as API. It's kinda good to have only a few less variables there to keep theming easy. The code block can be only seen in a very few areas right?

I do not really mind about exposing the code block and those variables, as long as we don't starting exposing too many variables / elements over time. It makes things more complicated for plugin developers and we have to maintain more etc.

@mnapoli
Copy link
Contributor Author

mnapoli commented May 1, 2015

we make this (the code block and the less variables) basically a public API

The code blocks are API as pre and code are HTML elements. I'm just trying to make them consistent and look good according to the redesign.

The less variables are useful for theming, if I want to theme Piwik I might want to customize those colors. If you are concerned about theming being too difficult because there are too many variables that can be customized, then I guess maybe we could have 2 Less files containing variables, one with the "simple" variables, and one with the "advanced" variables… I don't think it would make anything better but if that's a concern why not. Theming is currently inexistant though and I think you are trying to solve a problem that we don't have.

@tsteur
Copy link
Member

tsteur commented May 3, 2015

Theming is currently inexistant though and I think you are trying to solve a problem that we don't have.

We do not know whether theming is actually inexistant. Just because there are not many plugins on the Marketplace doesn't mean anything. There are eg agencies that do change a few colors to adjust Piwik to their branding. Those agencies/companies would of course not publish their plugin on the marketplace.

I'm not trying to solve any problem. I even said I don't mind adding them. We just need to be aware that we expose things here. Which means it needs to be documented and maintained.

Having 2 less files sounds good. We could have like a "basic.less" and an "advanced.less". I would as well move all the @theme-color-background* variables to advanced.less. Currently, the "advanced" ones are in _colors.less. To make things simpler for developers eg @theme-color-code-background could default to @color-silver-l30 which is I think the same value (or we could directly use this less variables there and not introduce a new one). Maybe there's also a color value for the other variable. Eg if we use #F2F2F2 instead of #F3F3F3 we could use @color-silver-l95. This is how it is currently done in other cases.

@mnapoli mnapoli changed the title Code blocks redesign New design for code blocks May 10, 2015
@mnapoli
Copy link
Contributor Author

mnapoli commented May 10, 2015

@tsteur I have created #7876 regarding the problem you mentioned. I think this solves the problem:

  • what's added to the demo page are the base HTML elements <pre> and <code> so these are API (as they are standard HTML tags)
  • the less variables will be moved in the less file containing the non-API variables

diosmosis added a commit that referenced this pull request May 10, 2015
Apply new design for code blocks (<code>/<pre> elements). Includes some styles cleanup for code/pre styles.
@diosmosis diosmosis merged commit 61f436b into master May 10, 2015
@diosmosis diosmosis deleted the redesign-codeblocks branch May 10, 2015 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Design / UI For issues that impact Matomo's user interface or the design overall. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants