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

A collection of small style adjustments #220

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

stanio
Copy link
Contributor

@stanio stanio commented Sep 3, 2024

These are small style adjustments I'm currently using via "user styles". See the individual commit messages for some more details, while I'll leave some Before and After screenshots here:

  • Give .collapsible.collapsed { height: 1lh }


    Using #json { line-height: 2 }:

    collapsed-before collapsed-after
  • Avoid horizontal scroll with very long string or link values
    long-link-before long-link-after
    long-string-before long-string-after

    Firefox breaks somewhat more by default:

    firefox-long-before firefox-long-after
  • Specify <meta name="color-scheme" content="light dark">
    selection-color-before selection-color-after

    Firefox View > Page Style > No Style:

    no-style-before no-style-after
  • Force transparent background for "collapsed" text selection
    translucent-selection-before translucent-selection-after
  • Specify widths/lengths in ch unit
    indent-before indent-after
  • Enlarge .collapser width/click-area

See if you may be interested in any of these.

Amends bhollis#98 with a more reliable declaration ensuring visible ellipsis with
any font's normal line height, incl. custom line-height.

'lh' is more recently implemented CSS unit:

-   https://developer.mozilla.org/en-US/docs/Web/CSS/length#lh
-   https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units#line_height_units

so keep the original `line-height: 1.2` as a fallback.
-   https://developer.mozilla.org/en-US/docs/Web/CSS/word-break

Alternative could be:

    overflow-wrap: break-word;

but the former ensures the value starts at the same line as the property
name, for example.
Standard metadata names
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name>:

>   color-scheme: specifies one or more color schemes with which
>   the document is compatible.  The browser will use this information
>   in tandem with the user's browser or device settings to determine
>   what colors to use for everything from background and foregrounds
>   to form controls and scrollbars.

This also adjusts the selection/highlight colors, all CSS system colors:

-   https://drafts.csswg.org/css-color/#css-system-colors

It could prevent "white flashes" in some contexts.

The difference with the CSS `color-scheme` property [1] is, for example,
with Firefox View > Page Style > No Style it still honors the browser's
color theme.

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme
stanio

This comment was marked as outdated.

@stanio
Copy link
Contributor Author

stanio commented Sep 4, 2024

  • Specify widths/lengths in ch unit
  • Enlarge .collapser width/click-area

I'll drop these last two from this PR as I'm still tweaking them for myself.

@bhollis
Copy link
Owner

bhollis commented Sep 10, 2024

Awesome, thank you! I'll take a look through these and see what can be merged!

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.

2 participants