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

Quote block: Border added through theme.json removed on alternate styles #37670

Open
ryelle opened this issue Dec 30, 2021 · 4 comments
Open
Labels
[Block] Quote Affects the Quote Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended

Comments

@ryelle
Copy link
Contributor

ryelle commented Dec 30, 2021

In my custom theme, I've added a border to the quote block in theme.json. It works fine with the default style, but if "Plain" or "Large" is selected, it creates a difference between frontend & editor. The border exists in the editor, but disappears on the frontend. Since I intentionally added a border in theme.json, I expect it to be there on all quote styles.

This also happens if the quote has text alignment = center, but I noticed that after taking my screenshots :)

Snippet from theme.json

"core/quote": {
  "border": {
	"color": "var(--wp--preset--color--blue)",
	"style": "solid",
	"width": "0 2px"
  },
  "color": {
	"background": "var(--wp--preset--color--sky)",
	"text": "var(--wp--preset--color--navy)"
  },
  "spacing": {
	"padding": "var(--wp--custom--spacing--horizontal)"
  }
},

In the editor, the theme.json rendered styles win, but on the frontend, the quote block's theme.css styles win.

Editor Frontend
editor frontend

Note that this is technically happening in Twenty Twenty-Two, but since the theme.json there only defines a width, the border: none means it's trying to render a 1px "none" border in the editor, so the editor & frontend appear to match.

Editor Frontend
editor frontend

Might be related to #35740?

Screenshots from Gutenberg 12.2.0 on WP 5.9-beta4-52422.

@ryelle ryelle added [Block] Quote Affects the Quote Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Dec 30, 2021
@dashkevych
Copy link

The similar issue was posted here: #37198

@mrleemon
Copy link
Contributor

I don't know if my bug is related to this, but I've added the following code to my theme theme.json file but in WP 6.0 RC3 it's completely ignored on frontend (no problems on backend):

"core/quote": {
    "color": {
        "background": "transparent",
        "text": "var(--theme-secondary-text-color)"
    },
    "border": {
        "width": "3px",
        "style": "solid",
        "color": "var(--theme-secondary-text-color)"
    },
    "spacing": {
        "margin": {
            "bottom": "1.6em"
        },
        "padding": {
            "top": "0",
            "right": "1.5em",
            "bottom": "0",
            "left": "1.5em"
        }
    },
    "typography": {
        "fontSize": "1rem",
        "fontFamily": "Georgia, \"Times New Roman\", \"Bitstream Charter\", Times, serif",
        "lineHeight": "1.4"
    }
},

@mtias mtias added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jul 27, 2022
@carolinan
Copy link
Contributor

carolinan commented Aug 3, 2022

If am not sure what we can do except:

  1. Removing the style (Which I do not recommend since there were issues after removing the large style)
  2. Renaming the style to "No border" and enforce the style in the editor and front even if theme.json is used.
  3. Deregister the style for any theme that styles the quote block
  4. Encourage theme authors to deregister the style if they don't want it in their theme.

@carolinan
Copy link
Contributor

There is a similar issue with the button block outline style option:
#35438
#42097

@jordesign jordesign added the [Type] Bug An existing feature does not function as intended label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Quote Affects the Quote Block [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants