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] Unable to change width of left border for both left and right alignments #37198

Open
kjellr opened this issue Dec 7, 2021 · 2 comments
Labels
[Block] Quote Affects the Quote Block CSS Styling Related to editor and front end styles, CSS-specific issues. 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

@kjellr
Copy link
Contributor

kjellr commented Dec 7, 2021

It's possible to set the width of the quote block's borer from within theme.json like so:

"core/quote": {
  "border": {
    "width": "0 0 0 1px"
  }
}

This works great when the block is in its default left alignment state. In the editor, this border disappears when you choose center or right alignment:

Screen Shot 2021-12-07 at 2 18 05 PM

In the front-end though, the original, un-customized border is present for right alignment:

Screen Shot 2021-12-07 at 2 19 54 PM

At a minimum, we should be sure to clear that from the front-end so that the appearance matches the editor. But a more complete solution would be to allow themes to customize the border width and then have that applied to the left when the text is aligned left, or to the right if the text is aligned left.


Tested with Gutenberg 12.1
Related: WordPress/twentytwentytwo#278

@kjellr kjellr added [Type] Bug An existing feature does not function as intended Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Dec 7, 2021
@kjellr
Copy link
Contributor Author

kjellr commented Jan 3, 2022

If a theme specifies the width like this, it works correctly in the editor:

"core/quote": {
  "border": {
    "width": "1px"
  }
}

Screen Shot 2022-01-03 at 9 14 30 AM

.... but the front-end is still incorrect:

Screen Shot 2022-01-03 at 9 14 40 AM

@sabernhardt
Copy link
Contributor

#59457 reduced the selector specificity with :where() in theme.scss, but the global styles also reduced specificity and Twenty Twenty-Two still has the thicker border for Quote blocks aligned right.

/* quote/theme.scss */
:where(.wp-block-quote).has-text-align-right {
  border-left: none;
  border-right: .25em solid;
  padding-left: 0;
  padding-right: 1em;
}
/* theme.json global styles with Twenty Twenty-Two */
:where(.wp-block-quote) {
  border-width: 1px;
}

The border width seems correct in left-to-right languages when the stylesheet has &:where(.has-text-align-right) too:

@ellatrix ellatrix added the CSS Styling Related to editor and front end styles, CSS-specific issues. label Jul 12, 2024
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 CSS Styling Related to editor and front end styles, CSS-specific issues. 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

4 participants