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

Set the default border style to "solid" #39123

Closed
hanneslsm opened this issue Feb 28, 2022 · 1 comment
Closed

Set the default border style to "solid" #39123

hanneslsm opened this issue Feb 28, 2022 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Design Feedback Needs general design feedback.

Comments

@hanneslsm
Copy link

What problem does this address?

When adding the border properties in theme.json, I might not include "style": true. I'll get all the other elements in the UI, but they are useless, because no default border style is defined and no border will be shown.
"settings": { "border": { "color": true, "radius": true, "width": true },...
image

Even if I set the style to be true, I think the border style should have a default fallback, because the UI isn't that inutivelty showing me that I also have to click on one style to activate it.
image

What is your proposed solution?

Either add a default border style in Gutenberg or give the option to define a default in the theme.json.

@karmatosed karmatosed added Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Design Feedback Needs general design feedback. labels Mar 30, 2022
@aaronrobertshaw
Copy link
Contributor

This issue relates to the old border controls, which were updated in #37770. That PR also added additional default styles applying a solid border style to those added via #33743.

These defaults aren't bulletproof as it's still possible for blocks or themes to define border styles with a higher specificity however I believe they mostly achieve the proposed solution here.

Unfortunately, I don't think there is a way of determining when a block will have border color/width applied via theme.json or global styles CSS and then apply a default border style as well. In this scenario however, the theme author can still explicitly state the border style they are chasing.

	...
	"styles": {
		"blocks": {
			"core/group": {
				"border": {
					"color": "cyan",
					"width": "0.5em",
					"style": "solid"
				}
			}
		},
	}

While testing this I found a bug preventing the disabling/hiding of the border style control within the current border UI. A separate fix for that is up in #43109.

As this issue relates more specifically to "default" border styles, I'll close it for now.

Thanks for reporting this @hannesdev; please let me know if there are further tweaks we can make to the border support experience. 👍


Click for demo of border support with style control disabled (using #43109)
Screen.Recording.2022-08-10.at.4.48.57.pm.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json Needs Design Feedback Needs general design feedback.
Projects
None yet
Development

No branches or pull requests

3 participants