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

Try: Make focus width a CSS variable. #27968

Merged
merged 1 commit into from
Jan 5, 2021
Merged

Conversation

jasmussen
Copy link
Contributor

Alternative to #27926, and also aims to fix #27925. CC and props: @stokesman

The most urgent issue is that on 1x normal resolution screens, the 1.5px focus style rounds badly, causing the issues outlined in #27925.

This PR adds the following base style:

--wp-admin-border-width-focus: 2px;
@media ( -webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
	--wp-admin-border-width-focus: 1.5px;
}

In other words, it makes the thickness of the focus style a CSS variable. This CSS variable is then overridden on high resolution screens. In my testing (Chrome, Safari, Firefox), it works as advertised:

2x screen:

Screenshot 2021-01-04 at 12 19 24

1x Firefox (note, emulated):

Screenshot 2021-01-04 at 12 23 38

As far as I can tell, this solves the rounding issue, but lets us keep the more balanced but still thicker focus style for high resolution screens.

In addition to this, the move to making the focus style a CSS variable means that users can override these easily, whether through plugins or even a future option in settings, should you want a thicker focus style:

Screenshot 2021-01-04 at 12 32 09

This needs good testing. In addition, the placement of these rules in the mixin means the CSS variables are duplicated many times. This appears to be an existing issue, but I'm happy to move the initial definition somewhere else, for example to the block-list stylesheet.

@github-actions
Copy link

github-actions bot commented Jan 4, 2021

Size Change: +14.7 kB (+1%)

Total Size: 1.26 MB

Filename Size Change
build/block-directory/style-rtl.css 1.01 kB +68 B (+7%) 🔍
build/block-directory/style.css 1.01 kB +69 B (+7%) 🔍
build/block-editor/style-rtl.css 11.4 kB +99 B (+1%)
build/block-editor/style.css 11.3 kB +98 B (+1%)
build/block-library/blocks/archives/editor-rtl.css 196 B +76 B (+63%) 🆘
build/block-library/blocks/archives/editor.css 196 B +77 B (+65%) 🆘
build/block-library/blocks/audio/editor-rtl.css 194 B +76 B (+64%) 🆘
build/block-library/blocks/audio/editor.css 194 B +76 B (+64%) 🆘
build/block-library/blocks/audio/style-rtl.css 225 B +73 B (+48%) 🚨
build/block-library/blocks/audio/style.css 225 B +73 B (+48%) 🚨
build/block-library/blocks/block/editor-rtl.css 283 B +72 B (+34%) 🚨
build/block-library/blocks/block/editor.css 283 B +72 B (+34%) 🚨
build/block-library/blocks/button/editor-rtl.css 576 B +63 B (+12%) ⚠️
build/block-library/blocks/button/editor.css 577 B +64 B (+12%) ⚠️
build/block-library/blocks/button/style-rtl.css 552 B +64 B (+13%) ⚠️
build/block-library/blocks/button/style.css 552 B +64 B (+13%) ⚠️
build/block-library/blocks/buttons/editor-rtl.css 345 B +70 B (+25%) 🚨
build/block-library/blocks/buttons/editor.css 346 B +71 B (+26%) 🚨
build/block-library/blocks/buttons/style-rtl.css 419 B +73 B (+21%) 🚨
build/block-library/blocks/buttons/style.css 419 B +73 B (+21%) 🚨
build/block-library/blocks/calendar/style-rtl.css 319 B +70 B (+28%) 🚨
build/block-library/blocks/calendar/style.css 319 B +70 B (+28%) 🚨
build/block-library/blocks/categories/editor-rtl.css 210 B +75 B (+56%) 🆘
build/block-library/blocks/categories/editor.css 209 B +74 B (+55%) 🆘
build/block-library/blocks/categories/style-rtl.css 208 B +76 B (+58%) 🆘
build/block-library/blocks/categories/style.css 208 B +76 B (+58%) 🆘
build/block-library/blocks/code/style-rtl.css 216 B +75 B (+53%) 🆘
build/block-library/blocks/code/style.css 216 B +75 B (+53%) 🆘
build/block-library/blocks/columns/editor-rtl.css 300 B +61 B (+26%) 🚨
build/block-library/blocks/columns/editor.css 299 B +60 B (+25%) 🚨
build/block-library/blocks/columns/style-rtl.css 529 B +62 B (+13%) ⚠️
build/block-library/blocks/columns/style.css 528 B +62 B (+13%) ⚠️
build/block-library/blocks/cover/editor-rtl.css 508 B +68 B (+15%) ⚠️
build/block-library/blocks/cover/editor.css 506 B +68 B (+16%) ⚠️
build/block-library/blocks/cover/style-rtl.css 1.33 kB +57 B (+4%)
build/block-library/blocks/cover/style.css 1.32 kB +57 B (+4%)
build/block-library/blocks/embed/editor-rtl.css 594 B +65 B (+12%) ⚠️
build/block-library/blocks/embed/editor.css 595 B +66 B (+12%) ⚠️
build/block-library/blocks/embed/style-rtl.css 489 B +70 B (+17%) ⚠️
build/block-library/blocks/embed/style.css 489 B +70 B (+17%) ⚠️
build/block-library/blocks/file/editor-rtl.css 314 B +68 B (+28%) 🚨
build/block-library/blocks/file/editor.css 313 B +68 B (+28%) 🚨
build/block-library/blocks/file/style-rtl.css 352 B +64 B (+22%) 🚨
build/block-library/blocks/file/style.css 352 B +63 B (+22%) 🚨
build/block-library/blocks/freeform/editor-rtl.css 2.55 kB +60 B (+2%)
build/block-library/blocks/freeform/editor.css 2.55 kB +62 B (+2%)
build/block-library/blocks/gallery/editor-rtl.css 749 B +57 B (+8%) 🔍
build/block-library/blocks/gallery/editor.css 750 B +57 B (+8%) 🔍
build/block-library/blocks/gallery/style-rtl.css 1.17 kB +62 B (+6%) 🔍
build/block-library/blocks/gallery/style.css 1.17 kB +63 B (+6%) 🔍
build/block-library/blocks/group/editor-rtl.css 433 B +69 B (+19%) ⚠️
build/block-library/blocks/group/editor.css 432 B +68 B (+19%) ⚠️
build/block-library/blocks/group/style-rtl.css 190 B +73 B (+62%) 🆘
build/block-library/blocks/group/style.css 190 B +73 B (+62%) 🆘
build/block-library/blocks/heading/editor-rtl.css 248 B +74 B (+43%) 🚨
build/block-library/blocks/heading/editor.css 248 B +74 B (+43%) 🚨
build/block-library/blocks/heading/style-rtl.css 212 B +75 B (+55%) 🆘
build/block-library/blocks/heading/style.css 212 B +75 B (+55%) 🆘
build/block-library/blocks/html/editor-rtl.css 384 B +62 B (+19%) ⚠️
build/block-library/blocks/html/editor.css 385 B +61 B (+19%) ⚠️
build/block-library/blocks/image/editor-rtl.css 801 B +63 B (+9%) 🔍
build/block-library/blocks/image/editor.css 800 B +63 B (+9%) 🔍
build/block-library/blocks/image/style-rtl.css 569 B +59 B (+12%) ⚠️
build/block-library/blocks/image/style.css 570 B +59 B (+12%) ⚠️
build/block-library/blocks/latest-comments/editor-rtl.css 277 B +76 B (+38%) 🚨
build/block-library/blocks/latest-comments/editor.css 275 B +75 B (+38%) 🚨
build/block-library/blocks/latest-comments/style-rtl.css 382 B +67 B (+21%) 🚨
build/block-library/blocks/latest-comments/style.css 382 B +67 B (+21%) 🚨
build/block-library/blocks/latest-posts/editor-rtl.css 254 B +71 B (+39%) 🚨
build/block-library/blocks/latest-posts/editor.css 254 B +71 B (+39%) 🚨
build/block-library/blocks/latest-posts/style-rtl.css 634 B +66 B (+12%) ⚠️
build/block-library/blocks/latest-posts/style.css 634 B +67 B (+12%) ⚠️
build/block-library/blocks/list/editor-rtl.css 203 B +74 B (+57%) 🆘
build/block-library/blocks/list/editor.css 203 B +74 B (+57%) 🆘
build/block-library/blocks/list/style-rtl.css 201 B +74 B (+58%) 🆘
build/block-library/blocks/list/style.css 201 B +74 B (+58%) 🆘
build/block-library/blocks/media-text/editor-rtl.css 311 B +71 B (+30%) 🚨
build/block-library/blocks/media-text/editor.css 311 B +71 B (+30%) 🚨
build/block-library/blocks/media-text/style-rtl.css 642 B +63 B (+11%) ⚠️
build/block-library/blocks/media-text/style.css 640 B +63 B (+11%) ⚠️
build/block-library/blocks/more/editor-rtl.css 545 B +66 B (+14%) ⚠️
build/block-library/blocks/more/editor.css 545 B +66 B (+14%) ⚠️
build/block-library/blocks/navigation-link/editor-rtl.css 503 B +65 B (+15%) ⚠️
build/block-library/blocks/navigation-link/editor.css 504 B +64 B (+15%) ⚠️
build/block-library/blocks/navigation-link/style-rtl.css 805 B +58 B (+8%) 🔍
build/block-library/blocks/navigation-link/style.css 803 B +58 B (+8%) 🔍
build/block-library/blocks/navigation/editor-rtl.css 1.38 kB +68 B (+5%) 🔍
build/block-library/blocks/navigation/editor.css 1.38 kB +69 B (+5%) 🔍
build/block-library/blocks/navigation/style-rtl.css 274 B +69 B (+34%) 🚨
build/block-library/blocks/navigation/style.css 274 B +69 B (+34%) 🚨
build/block-library/blocks/nextpage/editor-rtl.css 507 B +67 B (+15%) ⚠️
build/block-library/blocks/nextpage/editor.css 507 B +67 B (+15%) ⚠️
build/block-library/blocks/paragraph/editor-rtl.css 236 B +75 B (+47%) 🚨
build/block-library/blocks/paragraph/editor.css 236 B +75 B (+47%) 🚨
build/block-library/blocks/paragraph/style-rtl.css 351 B +72 B (+26%) 🚨
build/block-library/blocks/paragraph/style.css 352 B +73 B (+26%) 🚨
build/block-library/blocks/post-author/editor-rtl.css 329 B +74 B (+29%) 🚨
build/block-library/blocks/post-author/editor.css 329 B +74 B (+29%) 🚨
build/block-library/blocks/post-author/style-rtl.css 303 B +74 B (+32%) 🚨
build/block-library/blocks/post-author/style.css 303 B +73 B (+32%) 🚨
build/block-library/blocks/post-comments-form/style-rtl.css 358 B +65 B (+22%) 🚨
build/block-library/blocks/post-comments-form/style.css 358 B +65 B (+22%) 🚨
build/block-library/blocks/post-content/editor-rtl.css 262 B +75 B (+40%) 🚨
build/block-library/blocks/post-content/editor.css 262 B +75 B (+40%) 🚨
build/block-library/blocks/post-excerpt/editor-rtl.css 206 B +72 B (+54%) 🆘
build/block-library/blocks/post-excerpt/editor.css 206 B +72 B (+54%) 🆘
build/block-library/blocks/post-featured-image/editor-rtl.css 453 B +66 B (+17%) ⚠️
build/block-library/blocks/post-featured-image/editor.css 453 B +67 B (+17%) ⚠️
build/block-library/blocks/post-featured-image/style-rtl.css 223 B +74 B (+50%) 🆘
build/block-library/blocks/post-featured-image/style.css 223 B +74 B (+50%) 🆘
build/block-library/blocks/preformatted/style-rtl.css 193 B +74 B (+62%) 🆘
build/block-library/blocks/preformatted/style.css 193 B +74 B (+62%) 🆘
build/block-library/blocks/pullquote/editor-rtl.css 304 B +73 B (+32%) 🚨
build/block-library/blocks/pullquote/editor.css 304 B +73 B (+32%) 🚨
build/block-library/blocks/pullquote/style-rtl.css 428 B +69 B (+19%) ⚠️
build/block-library/blocks/pullquote/style.css 428 B +69 B (+19%) ⚠️
build/block-library/blocks/query-loop/editor-rtl.css 217 B +75 B (+53%) 🆘
build/block-library/blocks/query-loop/editor.css 216 B +75 B (+53%) 🆘
build/block-library/blocks/query-loop/style-rtl.css 427 B +66 B (+18%) ⚠️
build/block-library/blocks/query-loop/style.css 429 B +66 B (+18%) ⚠️
build/block-library/blocks/query/editor-rtl.css 279 B +69 B (+33%) 🚨
build/block-library/blocks/query/editor.css 279 B +69 B (+33%) 🚨
build/block-library/blocks/quote/editor-rtl.css 195 B +74 B (+61%) 🆘
build/block-library/blocks/quote/editor.css 195 B +74 B (+61%) 🆘
build/block-library/blocks/quote/style-rtl.css 284 B +69 B (+32%) 🚨
build/block-library/blocks/quote/style.css 285 B +71 B (+33%) 🚨
build/block-library/blocks/rss/editor-rtl.css 307 B +62 B (+25%) 🚨
build/block-library/blocks/rss/editor.css 309 B +63 B (+26%) 🚨
build/block-library/blocks/rss/style-rtl.css 394 B +65 B (+20%) 🚨
build/block-library/blocks/rss/style.css 393 B +65 B (+20%) 🚨
build/block-library/blocks/search/editor-rtl.css 285 B +72 B (+34%) 🚨
build/block-library/blocks/search/editor.css 285 B +72 B (+34%) 🚨
build/block-library/blocks/search/style-rtl.css 454 B +70 B (+18%) ⚠️
build/block-library/blocks/search/style.css 456 B +70 B (+18%) ⚠️
build/block-library/blocks/separator/editor-rtl.css 229 B +78 B (+52%) 🆘
build/block-library/blocks/separator/editor.css 229 B +78 B (+52%) 🆘
build/block-library/blocks/separator/style-rtl.css 352 B +71 B (+25%) 🚨
build/block-library/blocks/separator/style.css 352 B +71 B (+25%) 🚨
build/block-library/blocks/shortcode/editor-rtl.css 603 B +56 B (+10%) ⚠️
build/block-library/blocks/shortcode/editor.css 603 B +56 B (+10%) ⚠️
build/block-library/blocks/site-logo/editor-rtl.css 321 B +70 B (+28%) 🚨
build/block-library/blocks/site-logo/editor.css 321 B +70 B (+28%) 🚨
build/block-library/blocks/site-logo/style-rtl.css 238 B +72 B (+43%) 🚨
build/block-library/blocks/site-logo/style.css 238 B +72 B (+43%) 🚨
build/block-library/blocks/social-link/editor-rtl.css 283 B +72 B (+34%) 🚨
build/block-library/blocks/social-link/editor.css 283 B +72 B (+34%) 🚨
build/block-library/blocks/social-links/editor-rtl.css 811 B +62 B (+8%) 🔍
build/block-library/blocks/social-links/editor.css 810 B +61 B (+8%) 🔍
build/block-library/blocks/social-links/style-rtl.css 1.44 kB +64 B (+5%) 🔍
build/block-library/blocks/social-links/style.css 1.44 kB +64 B (+5%) 🔍
build/block-library/blocks/spacer/editor-rtl.css 390 B +69 B (+21%) 🚨
build/block-library/blocks/spacer/editor.css 390 B +69 B (+21%) 🚨
build/block-library/blocks/spacer/style-rtl.css 184 B +77 B (+72%) 🆘
build/block-library/blocks/spacer/style.css 184 B +77 B (+72%) 🆘
build/block-library/blocks/subhead/editor-rtl.css 223 B +75 B (+51%) 🆘
build/block-library/blocks/subhead/editor.css 223 B +75 B (+51%) 🆘
build/block-library/blocks/subhead/style-rtl.css 210 B +76 B (+57%) 🆘
build/block-library/blocks/subhead/style.css 210 B +76 B (+57%) 🆘
build/block-library/blocks/table/editor-rtl.css 593 B +63 B (+12%) ⚠️
build/block-library/blocks/table/editor.css 593 B +63 B (+12%) ⚠️
build/block-library/blocks/table/style-rtl.css 501 B +68 B (+16%) ⚠️
build/block-library/blocks/table/style.css 501 B +68 B (+16%) ⚠️
build/block-library/blocks/tag-cloud/editor-rtl.css 237 B +75 B (+46%) 🚨
build/block-library/blocks/tag-cloud/editor.css 235 B +73 B (+45%) 🚨
build/block-library/blocks/tag-cloud/style-rtl.css 221 B +76 B (+52%) 🆘
build/block-library/blocks/tag-cloud/style.css 221 B +76 B (+52%) 🆘
build/block-library/blocks/template-part/editor-rtl.css 714 B +70 B (+11%) ⚠️
build/block-library/blocks/template-part/editor.css 714 B +69 B (+11%) ⚠️
build/block-library/blocks/text-columns/editor-rtl.css 220 B +74 B (+51%) 🆘
build/block-library/blocks/text-columns/editor.css 220 B +74 B (+51%) 🆘
build/block-library/blocks/text-columns/style-rtl.css 283 B +74 B (+35%) 🚨
build/block-library/blocks/text-columns/style.css 283 B +74 B (+35%) 🚨
build/block-library/blocks/verse/editor-rtl.css 194 B +76 B (+64%) 🆘
build/block-library/blocks/verse/editor.css 194 B +76 B (+64%) 🆘
build/block-library/blocks/verse/style-rtl.css 214 B +77 B (+56%) 🆘
build/block-library/blocks/verse/style.css 214 B +77 B (+56%) 🆘
build/block-library/blocks/video/editor-rtl.css 617 B +70 B (+13%) ⚠️
build/block-library/blocks/video/editor.css 617 B +69 B (+13%) ⚠️
build/block-library/blocks/video/style-rtl.css 303 B +62 B (+26%) 🚨
build/block-library/blocks/video/style.css 304 B +63 B (+26%) 🚨
build/block-library/common-rtl.css 1.01 kB +73 B (+8%) 🔍
build/block-library/common.css 1.01 kB +74 B (+8%) 🔍
build/block-library/editor-rtl.css 8.93 kB +61 B (+1%)
build/block-library/editor.css 8.93 kB +60 B (+1%)
build/block-library/style-rtl.css 8.53 kB +52 B (+1%)
build/block-library/style.css 8.53 kB +53 B (+1%)
build/block-library/theme-rtl.css 860 B +71 B (+9%) 🔍
build/block-library/theme.css 860 B +70 B (+9%) 🔍
build/components/style-rtl.css 15.4 kB +60 B (0%)
build/components/style.css 15.4 kB +61 B (0%)
build/edit-navigation/style-rtl.css 938 B +57 B (+6%) 🔍
build/edit-navigation/style.css 944 B +59 B (+7%) 🔍
build/edit-post/style-rtl.css 6.64 kB +172 B (+3%)
build/edit-post/style.css 6.63 kB +173 B (+3%)
build/edit-site/style-rtl.css 4.04 kB +128 B (+3%)
build/edit-site/style.css 4.04 kB +128 B (+3%)
build/edit-widgets/style-rtl.css 3.22 kB +119 B (+4%)
build/edit-widgets/style.css 3.22 kB +119 B (+4%)
build/editor/style-rtl.css 3.89 kB +55 B (+1%)
build/editor/style.css 3.89 kB +54 B (+1%)
build/format-library/style-rtl.css 620 B +73 B (+13%) ⚠️
build/format-library/style.css 621 B +73 B (+13%) ⚠️
build/list-reusable-blocks/style-rtl.css 601 B +125 B (+26%) 🚨
build/list-reusable-blocks/style.css 601 B +125 B (+26%) 🚨
build/nux/style-rtl.css 731 B +60 B (+9%) 🔍
build/nux/style.css 727 B +59 B (+9%) 🔍
ℹ️ View Unchanged
Filename Size Change
build/a11y/index.js 1.01 kB 0 B
build/annotations/index.js 3.48 kB 0 B
build/api-fetch/index.js 3.19 kB 0 B
build/autop/index.js 2.6 kB 0 B
build/blob/index.js 514 B 0 B
build/block-directory/index.js 8.16 kB 0 B
build/block-editor/index.js 125 kB 0 B
build/block-library/index.js 148 kB 0 B
build/block-serialization-default-parser/index.js 1.63 kB 0 B
build/block-serialization-spec-parser/index.js 2.77 kB 0 B
build/blocks/index.js 47.3 kB 0 B
build/components/index.js 163 kB 0 B
build/compose/index.js 10.8 kB 0 B
build/core-data/index.js 14.7 kB 0 B
build/data-controls/index.js 676 B 0 B
build/data/index.js 8.62 kB 0 B
build/date/index.js 31.4 kB 0 B
build/deprecated/index.js 610 B 0 B
build/dom-ready/index.js 418 B 0 B
build/dom/index.js 4.67 kB 0 B
build/edit-navigation/index.js 10.6 kB 0 B
build/edit-post/index.js 303 kB 0 B
build/edit-site/index.js 23.3 kB 0 B
build/edit-widgets/index.js 24.1 kB 0 B
build/editor/editor-styles-rtl.css 476 B 0 B
build/editor/editor-styles.css 478 B 0 B
build/editor/index.js 41.6 kB 0 B
build/element/index.js 4.22 kB 0 B
build/escape-html/index.js 578 B 0 B
build/format-library/index.js 6.24 kB 0 B
build/hooks/index.js 1.75 kB 0 B
build/html-entities/index.js 476 B 0 B
build/i18n/index.js 3.43 kB 0 B
build/is-shallow-equal/index.js 552 B 0 B
build/keyboard-shortcuts/index.js 2.22 kB 0 B
build/keycodes/index.js 1.67 kB 0 B
build/list-reusable-blocks/index.js 2.84 kB 0 B
build/media-utils/index.js 4.95 kB 0 B
build/notices/index.js 1.61 kB 0 B
build/nux/index.js 3.07 kB 0 B
build/plugins/index.js 2.23 kB 0 B
build/primitives/index.js 1.21 kB 0 B
build/priority-queue/index.js 636 B 0 B
build/redux-routine/index.js 2.68 kB 0 B
build/reusable-blocks/index.js 2.68 kB 0 B
build/rich-text/index.js 13 kB 0 B
build/server-side-render/index.js 2.44 kB 0 B
build/shortcode/index.js 1.56 kB 0 B
build/token-list/index.js 1.1 kB 0 B
build/url/index.js 2.73 kB 0 B
build/viewport/index.js 1.57 kB 0 B
build/warning/index.js 363 B 0 B
build/wordcount/index.js 1.07 kB 0 B

compressed-size-action

@stokesman
Copy link
Contributor

Great idea!

Porting your question from the other thread to this one:

#27926 (comment)

Quick question: I can't reproduce the rounding issues in Firefox on a 2x screen. Are you seeing rounding issues on a 2x screen, or are these issues primarily specific to 1x screens?

I can't reproduce on a 2x screen either so this solution is 🎯

I was excited to see this approach because it should fix the rounding inconsistencies that are also present in the general focus styles (which I hadn't brought up in #27925 just to keep the focus on the block highlight/selection indicators). To demonstrate:

Before

decimal-focus-width-1x.mp4

After

focus-width-1x.mp4

Much better! Though it can be seen there are the faintest of rounding differences still present.


Back to the topic of block outlining. I've tested this PR only on a 1x screen. It is a great improvement there.

It may be too micro to worry about but there can still be very slight rounding inconsistencies:
27968-rounding-magnify

So even with an integer spread-radius (2px instead of 1.5px) the box-shadow is still prone to very minor rounding differences. Because I was pretty sure that in #27926 all rounding problems were gone, I experimented and it seems the difference is the inset box-shadow is less susceptible to rounding differences. Here's a screen recording to demonstrate:

inset-vs-outset.mp4

That may not be easy to follow without some explanation. Line-height changes are used to emulate the type of variance that will exist between themes. First, line-height is changed slightly to exaggerate the rounding fuzz. Then the styles to inset the box-shadow (and inversely compensate the position/radius) are uncommented. The rounding fuzz vanishes and stays gone no matter the changes to line-height. Then the styles are switched again just to reiterate. It may help to pause and jog between some frames.

While I don't think the inset box-shadow styling would be problematic I've not really tested it and since the rounding issues are already mostly gone (and only present in Firefox on 1x screens) I'm not pushing to try it.

To sum up: LGTM.

@jasmussen
Copy link
Contributor Author

Awesome, thanks so much.

Much better! Though it can be seen there are the faintest of rounding differences still present.

Yep, I think this is worth keeping in mind as we explore further improvements. For example we could keep your initial ticket open, with the excellent detective work you just did in your comment above, to explore moving towards using only an inset shadow to enhance things further. Especially if shipping this fix in the mean time doesn't block that from happening. We'll have improvements to the somewhat embarrassing current issue, that don't preclude further enhancements.

Given your LGTM (thanks again for the review), I'll request a couple of reviews to make sure the rules I added are in the right CSS file, and then we can ship this!

@@ -454,6 +454,13 @@
// Darker shades.
--wp-admin-theme-color-darker-10: #{darken($color-primary, 5%)};
--wp-admin-theme-color-darker-20: #{darken($color-primary, 10%)};

// Focus style width.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gziolo or @aristath if either of you have time, is this the right place to register this rule? I placed it here because then it's in context of the other CSS variables registered. But the side-effect is that the rule is duplicated multiple times in the DOM (something to look at separately for the color, perhaps, but perhaps best to not exacerbate with this PR). Is there a more appropriate place to store this rule? The base block-list CSS perhaps? Thank you for looking!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's a bit unfortunate that it gets duplicated. There is an issue opened by @aristath: #27663 that track that behavior. I guess it's fine to land this PR and tackle code duplication separately 👍🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can I get approval? :)

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure you can, thanks for working on it 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minuscule issues with block highlight/selection styles
3 participants