lightspeedwp / lsx-design

A WordPress Block theme designed to work seamlessly with WooCommerce, supported by a Figma Design System.
https://lsx.design
GNU General Public License v3.0
26 stars 0 forks source link

Make sure that all CSS custom variables that are used in templates match existing variables. #24

Closed carolinan closed 1 year ago

carolinan commented 1 year ago

Describe the bug Follow up to https://github.com/lightspeedwp/lsx-design/issues/21 There are references in the templates to CSS variables that are not in the theme. These still work in a sense, because they have fallbacks:

style="padding-top:var(--wp--custom--spacing--small, 1.00rem)

krugazul commented 1 year ago

@carolinan , unfortunately we cannot remove these variables. They are part of WordPress, being generated from the theme.json file. We use these to custom variables to connect the "Design Tokens" from our Figma designs.

i.e https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/#css-custom-properties-presets-custom

carolinan commented 1 year ago

The default spacing CSS variables generated by WordPress are --wp--preset--spacing--X not --wp--custom--spacing--

--wp--custom--X is generated from theme.json settings > custom: https://github.com/lightspeedwp/lsx-design/blob/main/theme.json#L290

This theme only adds one custom spacing under settings, but multiple spacing presets under settings > spacing: https://github.com/lightspeedwp/lsx-design/blob/main/theme.json#L299

Just double checking that you did not mean--wp--custom--spacing--small to be --wp--preset--spacing--small.

krugazul commented 1 year ago

@carolinan , we have fixed these variables in a few commits in PR #33 ,