Skip to content

styles.css: no !important left; drop display: contents and text-indent - #471

Merged
Leo310 merged 2 commits into
mainfrom
chore/review-css-2
Sep 5, 2026
Merged

styles.css: no !important left; drop display: contents and text-indent#471
Leo310 merged 2 commits into
mainfrom
chore/review-css-2

Conversation

@Leo310

@Leo310 Leo310 commented Sep 5, 2026

Copy link
Copy Markdown
Member

Summary

Clears the plugin review's remaining CSS findings: 50 × !important, 2 × text-indent, 1 × display: contents. src/styles.css now contains no !important at all (the word survives only in comments).

Every override is rewritten to win on specificity, which meant understanding what each one was actually fighting:

  • The re-parented search input. Core's strongest rule for it is .is-mobile .prompt-input[type=text]:not(:placeholder-shown) (0,4,0); naming the modal, container and element (.prompt.s2b-search-modal .prompt-input-container input.s2b-inline-input, (0,4,1)) beats it. The only theme !important on this element (Cupertino's padding-inline-start) was already handled by the inline style updateInlineInputSpacing sets, so the CSS never needed to fight it. The .s2b-search-input twin rule from Resolve Obsidian plugin-review findings #465 duplicated this block on the same element and is removed along with its addClass. Neither core nor Baseline/Cupertino sets text-indent, so both resets go.
  • Mobile touch targets and touch reveals. These needed !important only because our own component rules used it (send button, composer icon buttons, message-nav). The component rules now use .chat-input-container button.send-message-button / scoped-ancestor selectors and no !important; the global rules name body.is-mobile plus the same ancestors and win on specificity. The send button also had inline width/height/background from sendButtonStyle — inline styles were the true reason for !important there, and they were silently defeating the 2.75rem mobile size (measured 28 px before, 44 px after). Only the custom properties stay inline.
  • Phone-sheet header button. Cupertino pins its top with !important; instead of out-shouting it, the button is shifted by the safe-area inset with translate, on top of whatever top core or the theme chose.
  • Chips wrapper is a real flex box (same 4 px gap, wraps with the input) instead of display: contents.

Verified live (slot vault)

  • Default theme, desktop: input resets (padding 0, no border/radius/background, line-box height), chips flex + tint, clear button centred, glow border.
  • Mobile emulation (app.emulateMobile): input pill stripped, CTA centred, send button 44 × 44 / radius 20, attach 44 × 44, model pill min-height 44.
  • Cupertino, desktop: JS-set 36 px inset still wins; right padding 0; height collapses to the line box.
  • Not verifiable here: @media (hover: none) reveals (emulation keeps a mouse) and the is-phone-only sheet header offset. Both are pure specificity/property changes; worth a glance on a phone.

Test plan

  • bun run check, format, lint, test (1652), bun run build
  • Live checks above

Every remaining override in the shared stylesheet is rewritten to win on
specificity instead:

- The re-parented search input (`.s2b-inline-input`) is addressed through
  the modal, the container and the element, which beats core up to
  `.is-mobile .prompt-input[type=text]:not(:placeholder-shown)`; the
  redundant `.s2b-search-input` twin and its JS addClass are gone, and so
  are the two `text-indent` resets (no core or theme rule sets it).
- The mobile touch-target and touch-reveal rules name `body.is-mobile` /
  `body` plus the same ancestors the component rules use. The component
  rules they fought (send button, composer icon buttons, message-nav) drop
  their own `!important` for a `.chat-input-container button.…` /
  scoped-ancestor selector, and the send button no longer carries inline
  width/height/background — inline styles were the real reason those
  needed `!important`, and they were also silently defeating the mobile
  2.75rem size.
- The phone-sheet header button is shifted by the safe-area inset with
  `translate` instead of fighting the theme's `!important` `top`.
- The chips wrapper is a real flex box instead of `display: contents`.

Verified live: default theme desktop (input resets, chips, clear button
centred, glow), mobile emulation (input pill stripped, CTA centred, send
button 44px/20px, attach 44px, model pill 44px), Cupertino desktop (JS
inset 36px still wins, right padding 0).
@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR removes stylesheet !important declarations and replaces them with scoped specificity, removes redundant search-input styling, restores mobile touch-target overrides, and replaces display: contents with a wrapping flex container.

  • Moves send-button presentation out of inline styles so responsive CSS can control its dimensions.
  • Strengthens component and mobile selectors without changing their intended visual behavior.
  • Gives the search input a nonzero flex basis so it remains usable alongside filter chips.
  • Uses translation rather than competing priority declarations for the phone safe-area offset.

Confidence Score: 5/5

The PR appears safe to merge, with the previously reported search-input collapse fully addressed and no new actionable issues identified.

The input now has a 6em flex basis inside a wrapping flex parent, causing it to wrap onto a usable line instead of collapsing beside the chip group. The previous thread was resolved, and the current implementation fully addresses its reported behavior.

Important Files Changed

Filename Overview
src/styles.css Replaces priority declarations and display: contents with scoped selectors and explicit wrapping flex behavior; the follow-up flex-basis change resolves the previous search-input collapse.
src/components/chat/Input.svelte Removes fixed visual properties from the send button’s inline style and uses component selectors that allow mobile sizing rules to win.
src/components/chat/MessageContainer.svelte Rewrites message-navigation button overrides to rely on scoped selector specificity.
src/components/modal/SearchModal.ts Removes the redundant search-input class while retaining the theme-dependent inline padding override.

Reviews (2): Last reviewed commit: "Search input: real flex basis so it wrap..." | Re-trigger Greptile

Comment thread src/styles.css
With the chips grouped in one flex item, a zero-basis input could shrink
to nothing beside a full chip row. A 6em basis makes it wrap to the next
line instead and then grow to fill it. Verified with eight chips: the
input lands on its own line at full width.
@Leo310
Leo310 merged commit 87872aa into main Sep 5, 2026
3 checks passed
@Leo310
Leo310 deleted the chore/review-css-2 branch September 5, 2026 16:32
Leo310 added a commit that referenced this pull request Sep 5, 2026
The stylesheet cleanup from the plugin review (#471): no !important left,
plus the mobile send-button size it uncovered. No user-facing change
intended.

minAppVersion unchanged at 1.11.4. Nothing touched PROVIDER_TEMPLATES,
src/skills/defaults/, BUILT_IN_TOOL_IDS or CURATED_PLUGIN_INTEGRATIONS,
so the site's enumerable facts need no refresh.
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.

1 participant