feat(theme): consolidate interactive cursors into one base layer - #15
Open
anilsoylu wants to merge 1 commit into
Open
feat(theme): consolidate interactive cursors into one base layer#15anilsoylu wants to merge 1 commit into
anilsoylu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The theme has no base cursor layer.
cursor: pointeris written by hand in eight places intheme/style.css, once per control, and anything the author forgets keeps the arrow. Text is worse: without abodydefault, every paragraph, heading and code block hands the reader an I-beam, so a docs page reads like one long text field.This adds the base layer next to the existing element defaults and drops the per-component declarations it now covers.
cursor: defaultgoes into the existingbodyrule, andtouch-action: manipulationsits next to the-webkit-tap-highlight-colorrule that is already there. That one kills the 300ms double-tap-zoom delay before a control activates on touch.summaryis in the pointer list because raw HTML passes through the Markdown renderer (src/markdown.js), so a page author writing<details><summary>gets a real disclosure widget in.entry-content.Removed as redundant
.header-button, .menu-toggle,.command-search-close,.sidebar-collapse-toggle,.sidebar-search-clear,.docs-nav-toggle,.copy-code, and thecursorline on.comment-form .submit, .post-password-form input[type="submit"]. Each one is a<button>intheme/inc/blocks.phportheme/assets/js/docs.js, so the base rule reaches all of them.Kept:
.drawer-scrim, which is a<div>the base layer cannot reach, and everycursor: default/not-allowedstate override, including.docs-nav.is-filtering .docs-nav-toggle.Scope
theme/style.cssonly. I left the elevencursor: pointerdeclarations inplugins/docspress-blocks/alone. DocsPress Blocks ships as its own installable plugin and its stylesheets carry literal fallbacks for every--dp-*token, so they are written to survive under another theme. No UA stylesheet gives<button>a pointer, so deleting those would regress every copy button and tab the moment the plugin runs without this theme.add_editor_style( 'style.css' )intheme/functions.phpalready loads the theme stylesheet into the editor canvas, so the base layer applies there too.A note on checkbox and radio
They are in the pointer list on purpose. Without them, the later
input, textarearule would put an I-beam on WordPress core's comment cookie-consent checkbox, which this theme already styles at.comment-form-cookies-consent label. The attribute selectors outrank the bareinput, so the cascade resolves without extra ordering rules.Verification
New test in
test/block-theme.test.jspins the four base rules, asserts the five deduplicated components no longer declare their own pointer, and guards the two intentional exceptions so a later refactor cannot quietly flatten them.npx vitest run test/block-theme.test.js -t "base layer"fails against unpatchedstyle.css, passes with the change.npm test: 132 passed.npx eslint .: clean.