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

block.json: set color property individually #24927

Closed
oandregal opened this issue Aug 31, 2020 · 4 comments · Fixed by #25314
Closed

block.json: set color property individually #24927

oandregal opened this issue Aug 31, 2020 · 4 comments · Fixed by #25314
Assignees
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Status] In Progress Tracking issues with work in progress

Comments

@oandregal
Copy link
Member

oandregal commented Aug 31, 2020

The implicit block attributes for colors we declare through block.json follow this logic:

CSS Property block.json (check presence of) Style attribute (block serialization) theme.json
--wp--style--color--link __experimentalColor.linkColor style.color.link styles.color.link
background __experimentalColor.gradients style.color.gradient styles.color.gradient
background-color __experimentalColor style.color.background styles.color.background
color __experimentalColor style.color.text styles.color.text

Text and background colors are coupled, although some blocks may not require them both at once.

@oandregal oandregal changed the title Set color property individually block.json: set color property individually Aug 31, 2020
@oandregal oandregal added the [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi label Aug 31, 2020
@mtias mtias mentioned this issue Aug 31, 2020
82 tasks
@jorgefilipecosta
Copy link
Member

Hi @nosolosw, the API's are experimental I guess we can simply change to have two separate properties __experimentalColor.color for color and __experimentalColor.background for "background-color" right?

@oandregal
Copy link
Member Author

I'd think we want to consolidate __experimentalColors with the same subkeys that they have in the style attribute and theme.json: link, gradient, background, text (updated issue description for clarity).

For context, a related PR where I tried to do this (but was held off due to other things) #24320

@kishanjasani
Copy link
Contributor

kishanjasani commented Aug 31, 2020

@jorgefilipecosta I am a little confused with the naming convention of these colors and some properties like __experimentalColors. Is it only for experimental purpose and may deprecated in future releases? Thanks 🙂

@jorgefilipecosta
Copy link
Member

@jorgefilipecosta I am a little confused with the naming convention of these colors and some properties like __experimentalColors. Is it only for experimental purpose and may deprecated in future releases? Thanks 🙂

Hi @kishanjasani, it is experimental because we are still developing and improving it so its shape and name could change in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants