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

Processor for background and text colors #2

Closed
SantosGuillamot opened this issue Feb 19, 2020 · 0 comments · Fixed by #22
Closed

Processor for background and text colors #2

SantosGuillamot opened this issue Feb 19, 2020 · 0 comments · Fixed by #22
Assignees
Labels

Comments

@SantosGuillamot
Copy link
Member

SantosGuillamot commented Feb 19, 2020

Description

Sometimes, we'd want to be able to specify the color of some elements instead of using the default one.

We'll have a color palette both in WP and in the Frontity project with the common colors used in the design, but we should accept custom colors too. Both the WP palette and the frontity.settings should have the same common colors defined.

We have to process both the background colors and the text colors, and it can be used inside any tag.

How it works

  • If we select a new background color in Gutenberg, it will add the class has-background-color.

  • If we select a new text color in Gutenberg, it will add the class has-text-color.

  • If the color selected for the background is inside the WP palette, it will add a new class with the format has-$slug-background-color, that should be process and matched with the frontity.settings.

  • If the color selected for the text is inside the WP palette, it will add a new class with the format has-$slug-color, that should be process and matched with the frontity.settings.

  • In order to access the $slug color inside frontity.settings, we can find it at state.theme.colors.$slug. The slug inside the class and in frontity.settings must match.

  • If we use a custom color code, for both the background and the text, it will be added inside the style attribute.

HTML

Normal paragraph

<p>Some paragraph</p>

Paragraph with palette colors in both background and text

<p class="has-text-color has-background has-frontity-color has-orange-background-color">Some paragraph</p>

Paragraph with custom colors in both background and text

<p class="has-text-color has-background" style="color: rgb(163, 39, 0); background-color: rgb(186, 173, 214);">Some paragraph</p>

Where to check

Inside /common-styles/ page:

  • Body with palette colors
  • Body with custom colors
@SantosGuillamot SantosGuillamot created this issue from a note in Sprint 1 (closed) (To do) Feb 19, 2020
This was referenced Feb 19, 2020
@DAreRodz DAreRodz moved this from To do to In progress in Sprint 1 (closed) Feb 25, 2020
@DAreRodz DAreRodz self-assigned this Feb 26, 2020
@DAreRodz DAreRodz moved this from In progress to Blocked in Sprint 1 (closed) Feb 27, 2020
@SantosGuillamot SantosGuillamot moved this from Blocked to In progress in Sprint 1 (closed) Mar 4, 2020
@SantosGuillamot SantosGuillamot moved this from In progress to To do in Sprint 1 (closed) Mar 4, 2020
@DAreRodz DAreRodz moved this from To do to In progress in Sprint 1 (closed) Mar 4, 2020
@DAreRodz DAreRodz moved this from In progress to In review in Sprint 1 (closed) Mar 4, 2020
Sprint 1 (closed) automation moved this from In review to Done Mar 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants