Skip to content

Add support for opacity style property to theme.json #46755

Open

Description

@mikachan

What problem does this address?

Users are not currently able to set the opacity of an element just from the theme.json file or Global Styles. This is a common design choice for things such as button pseudo states.

What is your proposed solution?

Add support for the opacity property.

Activity

  1. added
    Global Styles
    [Feature] Design Tools
    on Dec 23, 2022
  2. npneeraj commented on Dec 24, 2022

    @npneeraj

    @mikachan please assign me this issue / feature . I can contribute to add/do the above following task.

  3. mikachan commented on Dec 24, 2022

    @mikachan
    MemberAuthor

    Done, thank you! ✨ I'm happy to review a PR when you're ready.

  4. npneeraj commented on Jan 4, 2023

    @npneeraj

    @mikachan I have read the docs and the theme.json file but I am confused where to add the opacity property since the theme.json seems to be of declaration file. I could not find the CSS file. Please share some hints or relevant resources that could be of any help, since I am new to OpenSource World.

  5. mikachan commented on Jan 5, 2023

    @mikachan
    MemberAuthor

    Hi @npneeraj. Here are some links that may help to explain the theme.json file further:

    This issue is for adding support for the opacity property to the theme.json file so it can be used to style blocks.

    Here is a similar PR for adding support for box-shadow: #41972

    If you prefer, I can start a PR for this, and I'm happy for you to help by contributing code or reviewing it.

  6. changed the title [-]Add `opacity` style property to theme.json[/-] [+]Add support for `opacity` style property to theme.json[/+] on Jan 5, 2023
  7. npneeraj commented on Jan 6, 2023

    @npneeraj

    Hi @mikachan . Thanks for sharing the above resources.
    Please start a PR for this for future code contributions and code-reviews.

  8. added
    [Type] Enhancement
    on Jul 27, 2023
  9. hanneslsm commented on Oct 27, 2023

    @hanneslsm

    Hey @npneeraj – any progress on this?
    This is becoming important since the File block has a hard coded opacity value on hover which can't be overwritten via the theme.json yet:

  10. npneeraj commented on Oct 28, 2023

    @npneeraj

    Hi @hanneslsm - sorry to say, it appears to be a dead-end.

  11. t-hamano commented on Jul 14, 2025

    @t-hamano
    Contributor

    I'd like to confirm if it's still worth working on this issue. Personally, I think it is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Global Styles[Feature] Design Tools[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions