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

Style engine: add handling of spacing presets #41700

Closed
wants to merge 30 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6f3244b
Add initial new space preset settings
Jun 23, 2022
5671bfe
Update theme.json schema
Jun 23, 2022
572a074
Remove invalid deprecated settings
Jun 6, 2022
d4b4cfe
More theme.json changes
Jun 23, 2022
b700c2e
Change size-slug to numbers to make it easier for theme authors to in…
Jun 7, 2022
f8590b1
Change naming from t-shirt sizes to full word
Jun 7, 2022
1498862
Update docs
Jun 7, 2022
ce4f430
Remove class generation for now as possibly not needed.
Jun 8, 2022
9443730
switch to empty array to match duotone
Jun 8, 2022
8618cb9
Add a spacing scale option
Jun 10, 2022
ec158d4
An a 0 space option
Jun 10, 2022
91b3e7f
Switch back to slugs as multiples of ten to make it is for themes to …
Jun 10, 2022
17ca2ce
Give a theme's spacingSizes setting priority over core spacingScale
Jun 13, 2022
7170253
Update comment
Jun 13, 2022
30e24d2
Move setting of spacing presets into theme json merge method
Jun 13, 2022
efd0472
Remove unchanged method from 6.1 compat file
Jun 15, 2022
b6ce06f
Check for valid spacing.spacingScale values before generating spacing…
Jun 16, 2022
9da8810
Add warning message if spacingScale values invalid
Jun 16, 2022
1637b5a
Fixing issue with current_step not numeric
Jun 16, 2022
b3b3b1b
Fix linting errors
Jun 16, 2022
962608a
Update docs
Jun 16, 2022
4892886
Remove note about generation of classname for now
Jun 16, 2022
a055ce9
Fix theme.json schema issues
Jun 20, 2022
d2ad7b4
One more theme.json change
Jun 20, 2022
fa70ddc
Switch to a wider default scale using a 1.5 multiplier and t-shirt sizes
Jun 22, 2022
3f78238
Mover generation of spacing presets until after the theme.json files …
Jun 22, 2022
fd68422
Switch back to numeric slugs
Jun 22, 2022
e23e954
Reduce length of preset var
Jun 22, 2022
6539042
Translation fix
Jun 23, 2022
eef6401
Remove 0 step and improve translation of tshirt size names
Jun 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Switch back to slugs as multiples of ten to make it is for themes to …
…add additional values between core defaults
  • Loading branch information
Glen Davies committed Jun 23, 2022

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 91b3e7f05920d297efbc307531c8012e2b1f06f4
4 changes: 2 additions & 2 deletions lib/compat/wordpress-6.1/class-wp-theme-json-6-1.php
Original file line number Diff line number Diff line change
@@ -552,7 +552,7 @@ protected static function get_spacing_sizes( $spacing_scale ) {
);
$spacing_sizes[] = array(
'name' => 1,
'slug' => 1,
'slug' => 10,
'size' => $spacing_scale['firstStep'] . $spacing_scale['units'],
);

@@ -565,7 +565,7 @@ protected static function get_spacing_sizes( $spacing_scale ) {

$spacing_sizes[] = array(
'name' => $x + 1,
'slug' => $x + 1,
'slug' => ( $x + 1 ) * 10,
'size' => $current_step,
);
}
10 changes: 5 additions & 5 deletions lib/compat/wordpress-6.1/theme.json
Original file line number Diff line number Diff line change
@@ -206,27 +206,27 @@
},
{
"name": "Extra small",
"slug": "1",
"slug": "10",
"size": "0.5rem"
},
{
"name": "Small",
"slug": "2",
"slug": "20",
"size": "1rem"
},
{
"name": "Medium",
"slug": "3",
"slug": "30",
"size": "1.5rem"
},
{
"name": "Large",
"slug": "4",
"slug": "40",
"size": "2rem"
},
{
"name": "Extra large",
"slug": "5",
"slug": "50",
"size": "2.5rem"
}
]