[wp-trac] [WordPress Trac] #56122: Explore allowing more layout-specific CSS properties in safe_style_css filter

WordPress Trac noreply at wordpress.org
Fri Jul 1 06:13:08 UTC 2022


#56122: Explore allowing more layout-specific CSS properties in safe_style_css
filter
--------------------------+-----------------------------
 Reporter:  andrewserong  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In the Gutenberg repo, I'm exploring a refactor for the Layout block
 support, that stores layout definitions in theme.json. One of the
 possibilities for outputting layout styles is to pass the layout
 definitions through `safecss_filter_attr`. In order to support the current
 Layout styles in Gutenberg, if we do this, I believe the following CSS
 properties would need to be added to the `safe_style_css` filter:

 * `display` (to support switching between `flex`, `grid` and other display
 modes)

 * `flex-wrap`
 * `gap` (this property now works with both flex and grid layout types)
 * `column-gap`
 * `row-gap`

 Logical margin and padding properties such as:

 * `margin-block-start`
 * `margin-block-end`
 * `margin-inline-start`
 * `margin-inline-end`
 * `padding-block-start`
 * `padding-block-end`
 * `padding-inline-start`
 * `padding-inline-end`

 Are there any blockers to adding in support for the above properties? All
 of them (except for `display`) appear to have precedents in the list of
 currently supported CSS properties, but I wasn't sure if there is a reason
 why `display` isn't already included.

 I'm happy to open up a PR that explores adding these in.

 For further context, the Gutenberg PR that explores refactoring the Layout
 block support is: https://github.com/WordPress/gutenberg/pull/40875

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56122>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list