Skip to content

block.json: set color property individually #24927

Closed

Description

@oandregal

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.

Activity

  1. changed the title [-]Set color property individually[/-] [+]block.json: set color property individually[/+] on Aug 31, 2020
  2. added
    [Feature] Design Tools
    on Aug 31, 2020
  3. jorgefilipecosta commented on Aug 31, 2020

    @jorgefilipecosta
    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?

  4. oandregal commented on Aug 31, 2020

    @oandregal
    MemberAuthor

    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

  5. kishanjasani commented on Aug 31, 2020

    @kishanjasani
    Contributor

    @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 🙂

  6. jorgefilipecosta commented on Sep 3, 2020

    @jorgefilipecosta
    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.

  7. added
    [Status] In Progress
    on Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Feature] Design Tools[Status] In Progress

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions