Repository navigation
refactor(lint): clear the directory scanner's CSS warnings - #728
Merged
Merged
Conversation
…eatures Remove the earlier copy of each property that a later declaration in the same rule overrides, so the computed styles stay the same. Replace `display: contents` on the year view's mini weekday header with a subgrid that spans the first row, and write the project properties grid's `column-gap` as `gap: 0 10px`. The scanner flags both features as only partially supported.
Obsidian's review scanner warns about :has because of its broad selector invalidation. Each element now gets a class from the code that renders it or changes its state, and the stylesheet keys off that class: - phone sidebars (forecast, projects, tags, review, task properties): is-left-column-visible / is-forecast-left-column-visible - calendar events and Task Genius calendar events with a checkbox, table cells with an expand button, habit heatmap cells with a pie dot - inline metadata editors built on a text input, and the project pill being edited - quick capture title bar without tabs, disabled status cycle cards, the tab header status container that holds the capture button - onboarding view and showcase layout flags Other rules use what the DOM already provides: the existing details-visible class, a sibling combinator for the forecast header and the Fluent top navigation, the right detail leaf's data-type, and `.is-phone` alone where the close button only exists on phones. Three rules for the removed legacy settings layout never matched and are deleted.
Obsidian's review scanner warns about !important. Each rule now wins through specificity against the rule it was overriding instead: - Obsidian input and button rules (table inline inputs, table control buttons, settings search input and clear button): scoped to their container and element, with explicit :hover/:focus/:active variants where Obsidian styles those states - Obsidian .setting-item and .markdown-rendered p, CodeMirror's .cm-focused outline, the calendar library's header and positioning: scoped under the plugin's own classes - the plugin's own later or more specific rules (task selection, month cell range preview, mobile table tree cells, status rows, the onboarding view grid, the no-progress-bar toggle): scoped, chained or excluded with :not() so the cascade result stays the same Declarations that nothing competes with just lose the flag. The !important steps inside two @Keyframes never applied (browsers ignore them), so those steps were removed rather than made effective. Kept on purpose: the event background colours that override the calendar library's inline colour, the table row-number width and min-width that override inline widths, and SortableJS's shared .sortable-ghost/.sortable-chosen state classes.
The community directory scanner lints the styles.css committed at the repo root, not the release asset. That file was a dev build from December 2025, so CSS fixes in src/styles never reached the scan. Add `node esbuild.config.mjs styles` (npm run build:styles): it writes only the root styles.css, unminified and without a source map so findings point at readable lines, and leaves main.js alone. release-it now runs it after the production build, so the committed file matches each release.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Clears most of the CSS warnings the community directory scanner reports. Counts are from the scanner's Stylelint rules:
!important:hasdisplay: contents/multicolumnWhy
styles.csschangesThe scanner lints the tracked
styles.cssat the repo root, not the release asset. Its line numbers match that file exactly. The committed file was a dev build from December 2025 (5610bc41), so CSS fixes insrc/stylesnever reached the scan.node esbuild.config.mjs styles(npm run build:styles) writes only the rootstyles.css, unminified and without a source map, so findings point at readable lines. It leavesmain.jsalone.styles.cssfrom the current sources, which accounts for the large diff on that file.Approach
!importantis replaced by enough specificity, e.g. scoping under the plugin's containers or chaining the element's own classes.:has(...)is replaced by a class that the TS code sets where it renders the element, e.g.has-task-checkbox,has-pie-dot,is-left-column-visibleandis-cycle-disabled.display: contents.Kept on purpose
!important(9):width/min-width(4):TableRenderersets them inline.:has(4):Verification
styles.cssshow the counts above. 33color-namedremain; the directory doesn't report that rule.Please check visually
Specificity changes can lose to a theme's more specific rule. These are the areas worth a look in Obsidian:
.no-progress-bar)One intended difference: in the views settings list, the item hovered while dragging now shows the drag colour instead of the hover colour.