Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Update theme.json to follow latest spec #2659

Merged
merged 10 commits into from
Oct 28, 2020
151 changes: 98 additions & 53 deletions seedlet-blocks/experimental-theme.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,103 @@
{
"global": {
"presets": {
"font-size": [
{
"slug": "tiny",
"value": "14px"
},
{
"slug": "small",
"value": "16px"
},
{
"slug": "medium",
"value": "18px"
},
{
"slug": "large",
"value": "24px"
},
{
"slug": "extra-large",
"value": "28px"
},
{
"slug": "huge",
"value": "32px"
},
{
"slug": "gigantic",
"value": "48px"
"settings": {
"color": {
"gradients": [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the gradient previews are broken when we supply the gradients via the theme.json:

Screen Shot 2020-10-26 at 2 37 15 PM

Other than that, this PR looks good to me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch, this is a bug that needs fixing. It's a bit convoluted and can take a few days of back/forth, so I'd like to offer an alternative to unblock this PR: use raw values to define the gradient presets instead of pointing to the color preset CSS variables.

I'll ping here when the fix lands in Gutenberg.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I've created an issue to better track this. You can subscribe over there!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @nosolosw! I'll keep an eye on that. @jffng would you mind re-testing? I think this should be all set now.

{
"slug": "hard-diagonal",
"gradient": "linear-gradient(to bottom right, #3C8067 49.9%, #FAFBF6 50%)"
},
{
"slug": "hard-diagonal-inverted",
"gradient": "linear-gradient(to top left, #3C8067 49.9%, #FAFBF6 50%)"
},
{
"slug": "hard-horizontal",
"gradient": "linear-gradient(to bottom, #3C8067 50%, #FAFBF6 50%)"
},
{
"slug": "hard-horizontal-inverted",
"gradient": "linear-gradient(to top, #3C8067 50%, #FAFBF6 50%)"
},
{
"slug": "diagonal",
"gradient": "linear-gradient(to bottom right, #3C8067, #FAFBF6)"
},
{
"slug": "diagonal-inverted",
"gradient": "linear-gradient(to top left, #3C8067, #FAFBF6)"
},
{
"slug": "horizontal",
"gradient": "linear-gradient(to bottom, #3C8067, #FAFBF6)"
},
{
"slug": "horizontal-inverted",
"gradient": "linear-gradient(to top, #3C8067, #FAFBF6)"
},
{
"slug": "stripe",
"gradient": "linear-gradient(to bottom, transparent 20%, #3C8067 20%, #3C8067 80%, transparent 80%)"
}
],
"palette": [
{
"slug": "background",
"color": "#FFFFFF"
},
{
"slug": "foreground",
"color": "#333333"
},
{
"slug": "primary",
"color": "#000000"
},
{
"slug": "secondary",
"color": "#3C8067"
},
{
"slug": "tertiary",
"color": "#FAFBF6"
}
]
},
"typography": {
"customFontSize": true,
"customLineHeight": true,
"fontSizes": [
{
"name": "Tiny",
"slug": "tiny",
"size": 14
},
{
"name": "Small",
"slug": "small",
"size": 16
},
{
"name": "Normal",
"slug": "normal",
"size": 18
},
{
"name": "Large",
"slug": "large",
"size": 24
},
{
"name": "Huge",
"slug": "huge",
"size": 28
}
],
"spacing": {
"customPadding": true,
"units": [ "px", "em", "rem", "vh", "vw" ]
}
],
"color": [
{
"slug": "background",
"value": "#FFFFFF"
},
{
"slug": "foreground",
"value": "#333333"
},
{
"slug": "primary",
"value": "#000000"
},
{
"slug": "secondary",
"value": "#3C8067"
},
{
"slug": "tertiary",
"value": "#FAFBF6"
}
]
}
}
}
}
}
2 changes: 0 additions & 2 deletions seedlet-blocks/style-editor.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ body {
--global--font-size-md: var(--wp--preset--font-size--medium);
--global--font-size-lg: var(--wp--preset--font-size--large);
--global--font-size-xl: var(--wp--preset--font-size--extra-large);
--global--font-size-xxl: var(--wp--preset--font-size--huge);
--global--font-size-xxxl: var(--wp--preset--font-size--gigantic);

/* Colors */
--global--color-background: var(--wp--preset--color--background);
Expand Down
12 changes: 5 additions & 7 deletions seedlet-blocks/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ GNU General Public License for more details.
Doubling up on the :root selector is weird, but it just ensures these have higher specificity than everything else) */
:root:root {
/* Font Size */
--global--font-size-xs: var(--wp--preset--font-size--tiny);
--global--font-size-sm: var(--wp--preset--font-size--small);
--global--font-size-md: var(--wp--preset--font-size--medium);
--global--font-size-lg: var(--wp--preset--font-size--large);
--global--font-size-xl: var(--wp--preset--font-size--extra-large);
--global--font-size-xxl: var(--wp--preset--font-size--huge);
--global--font-size-xxxl: var(--wp--preset--font-size--gigantic);
--global--font-size-xs: calc( 1px * var(--wp--preset--font-size--tiny) );
--global--font-size-sm: calc( 1px * var(--wp--preset--font-size--small) );
--global--font-size-md: calc( 1px * var(--wp--preset--font-size--normal) );
--global--font-size-lg: calc( 1px * var(--wp--preset--font-size--large) );
--global--font-size-xl: calc( 1px * var(--wp--preset--font-size--huge) );

/* Colors */
--global--color-background: var(--wp--preset--color--background);
Expand Down