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

Add CSS Custom Property for layout width to editor and frontend #36414

Closed
fabiankaegy opened this issue Nov 11, 2021 · 2 comments
Closed

Add CSS Custom Property for layout width to editor and frontend #36414

fabiankaegy opened this issue Nov 11, 2021 · 2 comments
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.

Comments

@fabiankaegy
Copy link
Member

Description

Pretty much all the options that we set in theme.json are available to theme & plugin authors via CSS Custom Properties. That is not the case for the layout width settings.

It would be really useful to be able to access the contentWidth and wideWidth values as custom properties.

{
  "version": 1,
  "settings": {
    "layout": {
      "contentSize": "800px",
      "wideSize": "1000px"
    }
  }
}

Based on the other properties the naming scheme would probably be something like:

--wp--preset--layout--content-size: 800px;
--wp--preset--layout--wide-size: 1000px;

Step-by-step reproduction instructions

does not apply

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@fabiankaegy fabiankaegy added [Type] Enhancement A suggestion for improvement. [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Nov 11, 2021
@chthonic-ds
Copy link
Contributor

See #30081.

@fabiankaegy
Copy link
Member Author

Thanks for raising that ticket :) Closing in favor of #30081.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants