Skip to content

Modernise TW Styling#9802

Draft
pmario wants to merge 29 commits into
TiddlyWiki:masterfrom
pmario:modernise-tw-styling
Draft

Modernise TW Styling#9802
pmario wants to merge 29 commits into
TiddlyWiki:masterfrom
pmario:modernise-tw-styling

Conversation

@pmario

@pmario pmario commented Apr 13, 2026

Copy link
Copy Markdown
Member

This is Work In Progress - More testing needed. Especially with WCAG contrast values.

Modernise TiddlyWiki default styling

Summary

This PR modernises TiddlyWiki's default visual appearance by:

  • Removing skeuomorphic CSS — 3D shadows, inset effects, gradient embossing, and SVG fill transitions replaced with flat, subtle shadows
  • Improving accessibility (WCAG AA) — Fixing contrast ratios for muted text, sidebar links, tag pills, and tiddler subtitles; restoring keyboard focus visibility (outline:none removal)
  • Dark theme compatibility — Replacing hardcoded CSS colours with <<colour>> palette references so all UI elements work across light and dark palettes
  • Adding button-background-hover palette entry — A new dedicated colour for button hover states, added to all 20 existing palettes
  • Fixing cross-theme elements — Improvement banner, Quick Start cards, and Community cards now work with both light and dark palettes
  • 9 new photo-inspired palettes — Bodeguita, IndianGarden, IndianMehndi, Marina, Mediterranee, Pool, RustedMetal, Sunrise, Sunset

Changes by area

Theme CSS (snowwhite + vanilla)

  • Tiddler frame: symmetric shadow, border-radius 2→8px
  • All inset shadows, gradients (including RTL sidebar), and embossing removed
  • Flat button styling with border-radius: 0.25em
  • Tab hover states for selected/unselected tabs
  • Dropdown text colour fix (specificity override for sidebar context)
  • Tiddler subtitle: tinted blue-grey, smaller, lighter weight

Palettes

  • Vanilla: tag-background, muted-foreground, sidebar-link, subtitle colours adjusted for contrast
  • SpartanNight: tag-foreground, sidebar-muted-foreground fixes
  • DarkPhotos: tag-foreground fix
  • Blue: sidebar-controls-foreground fix
  • Twilight: modal-footer-background fix
  • SpartanDay: button-border cleared
  • All 20 palettes: button-background-hover entry added
  • 9 new palettes (5 light, 4 dark)

tw5.com edition

  • Improvement banner: self-contained colour scheme (palette-independent)
  • Quick Start cards: removed hardcoded gradients, palette-referenced shadows
  • Community cards: card background/foreground/shadow → palette references
  • Audit tiddlers for visual testing (palette switcher, colour swatches)

Files changed

51 files, +1667 / −101 lines

Test plan

  • Visual check of all 29 palettes (20 existing + 9 new) using Audit: Palette Test Page
  • Verify WCAG AA contrast ratios (4.5:1 text, 3:1 UI components)
  • Check button hover states across light and dark palettes
  • Check dropdown text contrast in sidebar context
  • Check improvement banner, Quick Start cards, Community cards on dark palettes
  • Verify keyboard focus visibility on tag inputs and buttons
  • Check prefers-reduced-motion (not yet added — follow-up)

pmario and others added 11 commits April 9, 2026 19:29
…2.4.7)

Two rules suppress the :focus-visible outline that vanilla/base.tid
provides for all interactive elements:
- snowwhite: .tc-edit-tags input.tc-edit-texteditor { outline: none }
- vanilla: .tc-remove-tag-button { outline: none }

These made tag-editing inputs and the tag remove button invisible to
keyboard users. The vanilla theme already defines a proper focus ring
(2px solid primary) via :focus-visible, so these overrides were
actively harmful. Removing them restores keyboard accessibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…1.4.3)

Three foreground colours in the default palette had contrast ratios
well below WCAG AA minimums, making text hard to read for low-vision
users:

- muted-foreground: #bbbbbb → #949494 (1.9:1 → 3.0:1 on white,
  passes 3:1 for UI components per WCAG 1.4.11)
- sidebar-muted-foreground: #c0c0c0 → #8a8a8a (1.6:1 → 3.1:1
  on page-background)
- sidebar-tiddler-link-foreground: #999999 → #707070 (2.6:1 → 4.5:1
  on page-background, passes AA for normal text)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ubordinate

The subtitle (date/modifier) was #c0c0c0 on white (~1.8:1 contrast),
nearly invisible to low-vision users. A simple darkening to pass 4.5:1
made it too visually dominant, competing with the tiddler title.

Solution: combine a tinted blue-grey (#8090a0, ~3.4:1) that harmonises
with the navy title (#182955) so the eye groups them together, with
reduced font-size (0.9em → 0.8em) and font-weight (normal → 300) to
push metadata into the background. The tinting prevents the subtitle
from reading as independent content while remaining legible.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Apr 13, 2026

Copy link
Copy Markdown

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 761d48b
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/6a2b15fabac8110008fcd411
😎 Deploy Preview https://deploy-preview-9802--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

Copy link
Copy Markdown

Confirmed: pmario has already signed the Contributor License Agreement (see contributing.md)

@github-actions

github-actions Bot commented Apr 13, 2026

Copy link
Copy Markdown

📊 Build Size Comparison: empty.html

Branch Size
Base (master) 2491.8 KB
PR 2540.0 KB

Diff: ⬆️ Increase: +48.2 KB

🔴 Significant Increase

⚠️ Warning: Size increased significantly.


⚠️ Change Note Status

This PR appears to contain code changes but doesn't include a change note.

Please add a change note by creating a .tid file in editions/tw5.com/tiddlers/releasenotes/<version>/

📚 Documentation: Release Notes and Changes

💡 Note: If this is a documentation-only change, you can ignore this message.

@saqimtiaz

saqimtiaz commented Apr 13, 2026

Copy link
Copy Markdown
Member

@pmario the intent is to merge #8702 early after the v5.4 release. As such, it would be prudent to use that as a starting point for anything that touches upon palettes. The majority of the work needed on #8702 is on the UI side for configuration, it should otherwise be stable.

@pmario

pmario commented Apr 13, 2026

Copy link
Copy Markdown
Member Author

@saqimtiaz ... The changes to the TW CSS to make it look more modern are very subtle. The extra palettes are experiments because I think they are nice.

#8702 most likely will have the same contrast problems as the current tw-com has. Values in this draft can be used as a starting point to make it better.

tiddlywiki.com currently has problems with dark palettes. See screenshot below. I needed this changes to experiment with possible fixes, that will work with v5.4.0. We probably will need to live with it for the rest of the year.

image

@Jermolene

Copy link
Copy Markdown
Member

Hi @pmario I like the CSS changes that I've found so far, and would encourage you to go further, particularly with refinements to the appearance of tabs.

@Jermolene

Copy link
Copy Markdown
Member

#8702 most likely will have the same contrast problems as the current tw-com has. Values in this draft can be used as a starting point to make it better.

#8702 incorporates contrast checks which show up in the palette chooser.

pmario added 6 commits April 20, 2026 19:05
Segmented-control style tabs: pill-shaped container with rounded
selected-tab pill. Based on Snow White; registered in tw5.com edition.
GitHub / Primer style: transparent tabs with primary-coloured 2px
underline on selected. Based on Snow White; registered in tw5.com edition.
- $:/theme → Rounded Tabs (was Snow White)
- $:/palette timestamp refresh
- doc-styles: doc-tabs use larger 1.15rem font with snug 0.25em 0.75em
  padding so the selected pill hugs its text rather than looking puffy
- Expose palette and theme buttons in the page control toolbar
- tw5.com-server: add wikilabs/devtools plugin
- Container padding 4px → 2px, border-radius 10px → 8px so the pill
  hugs the buttons more tightly
- font-size: 0.95em on the tab-button container so tab labels read
  closer to body size (replacing vanilla's 0.85em default)
The first tab's left padding toggles between 0 and 8px based on its
selected state (flush-left when unselected; indented when selected),
which previously caused a visible jump on selection change.

Animate the transition:
  - 200ms slide-in (left → right) when first tab becomes selected
  - 300ms slide-out (right → left) when first tab becomes unselected
  - No animation when the first tab's state doesn't change (e.g.
    clicking between the 2nd and 3rd tabs)

TW rebuilds all tab buttons on every selection change, so the
animation has to be applied by JS only when the first-tab state
actually flips — a MutationObserver tracks it via a data-attribute.
The JS is an edition tiddler because theme plugins don't load JS
modules at boot.
@pmario

pmario commented Apr 20, 2026

Copy link
Copy Markdown
Member Author

@Jermolene ... I did add 2 experiments for different tab styles

2 new Themes:

  • Rounded tabs
  • Underlined tabs

Effected are Right Sidebar, Control Panel and Checkbox Widget Example section where the tabs is styled to be bigger. Screenshots follow.

Rounded tabs preview: Checkbox Widget - See right sidebar and tiddler body tabs

image

Rounded tabs: Control Panel

image

Underlined Control Panel

image

Underlined tabs: Checkbox widget .doc-tabs macro and right sidebar

image

pmario added 5 commits April 20, 2026 20:50
Some palettes (IndianGarden, Mediterranee, SpartanDay, SpartanNight,
Sunset) define tab-background and tab-border as transparent, assuming
vanilla's folder-tab style. Under Rounded Tabs this made the pill
container and the selected-pill outline invisible.

Layer a low-opacity rgba overlay under the container background and
add an inset box-shadow fallback on the selected pill border. Both
stack imperceptibly on top of a real palette colour when one is
defined, and provide minimum visibility when the palette value is
transparent.
Five palettes had tab-foreground and/or very-muted-foreground set
too close to their backgrounds, making tab labels and .doc-attr
labels hard to read.

- IndianGarden: tab-fg #8a9878→#a8b898, very-muted #4a5a3a→#788868
- Mediterranee: tab-fg #788898→#98a8b8, very-muted #3a4450→#687888
- Sunset:       tab-fg #907858→#a89070, very-muted #483828→#786040
- SpartanDay:   tab-fg 0.54→0.62,       very-muted 0.12→0.42
- SpartanNight: tab-fg 0.54→0.70,       very-muted 0.12→0.42

Spartan's 0.12 very-muted value was Material Design's divider
opacity, never intended for readable text — .doc-attr uses this
colour for attribute labels so it needs to be visible.
Version number update for 5.4.0
@superuser-does

superuser-does commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Issues I found:

  1. The right side of the Sidebar Tabs are partially covered by the additional scrollbar:
    Screenshot for issue 1
  2. The 'Plugins' under 'More' run off the screen, which they didn't in the previous version:
    Screenshot for issue 2
  3. Vertical tabs appear to visually expand/retract when selecting a longer/shorter tab:
    See screencast

Tested on the Netlify preview.
System: Firefox 151.0.3 running on Fedora 44 KDE.

@Leilei332

Copy link
Copy Markdown
Contributor

Looks like the tab overflows on mobile, IMO it should be wrapped.

Screenshot_20260611-084916.jpg

@superuser-does

superuser-does commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

I would encourage one additional improvement. The default borders of $edit-text widgets are a bit "Windows 95" in most browsers and OSs, with thick, boxy outlines. They should be a little more minimal and rounded, at least when it's a single-line input.

If you are happy with this suggestion, consider extending to standard HTML input types too.

@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@Leilei332 ... can you check wikilabs.github.io .. It uses a plugin version of those themes.
You can change the theme from the sidebar toolbar, using the theme settings icon.

On my mobile it works as expected. -- It seems my mobile has a much higher resolution. ...
Which x/y resolution does your mobile have?

image

@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@Leilei332 ... I can replicated it with the FF dev - mobile preview Galyxy S10 settings. -- I will have a closer look

@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@superuser-does

  1. Vertical tabs appear to visually expand/retract when selecting a longer/shorter tab:
    See screencast

I can replicate this behaviour. IMO should be completely resolvable with some CSS tweaks.

I'll have a closer look - soon

Add a .tc-tab-buttons.tc-vertical block plus a sidebar+vertical override
so vertical tab sets get a modern stacked appearance instead of inheriting
vanilla's square bordered slab. Affected: Releases year/version picker
and the sidebar More sub-tabs.

Selected tile uses the palette's tab-background-selected (or sidebar-tab-
background-selected) wrapped in a 1px tab-border outline plus an inset
shadow. The border and shadow are necessary because Vanilla defines
tab-background-selected as #ffffff, identical to the tiddler bg, so a
bg-only treatment would be invisible on light palettes.

Unselected buttons carry a 1px transparent border to prevent a 1px
layout shift on selection.
@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

I would encourage one additional improvement. The default borders of $edit-text widgets are a bit "Windows 95" in most browsers and OSs, with thick, boxy outlines. They should be a little more minimal and rounded, at least when it's a single-line input.

If you are happy with this suggestion, consider extending to standard HTML input types too.

Thanks for the feedback

hihi, That's really hard for me. I personally hate the "all rounded" and "partially transparent" behaviour that is mainstream at the moment. (For me it did not work for Windows 20 years ago)

So adding "more" rounded corners to the tiddlers was OK, since I basically removed the "hard" drop shadows.

You are right. ... having rounded borders on input elements is mainstream currently.

  • I can do that. for users that want it
  • I will need to create a new personal theme that uses more subtle "roundings"

So there can be official plugins, with 2 versions. One rounded, one corner-ed ... for those of us who prefer rough edges.

I'll have a look.

@superuser-does

Copy link
Copy Markdown
Contributor

You make a good point. To be fair, I think the trend isn't necessarily towards rounded - so my bad on explaining it that way. I think it is rather towards thinner borders, which is where many OS's and browsers' thick default bevels fall down. Dimension is coming back (so moving away from flat UIs) but in a layered way & supported by animation. Tiddlywiki already has some dimension actually through toddlers.

Of course, these are the things becoming mainstream now; it's hard to predict what the next UI trend will be, but I think layered dimensionality and thin borders are here to stay.

Without flex-wrap, tab buttons overflowed off-screen on mobile widths
(e.g. ControlPanel's Keyboard Shortcuts tab). Add flex-wrap: wrap to
both themes; Underlined Tabs uses row-gap: 4px to clear the underline
indicator on a wrapped row.
@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

@Leilei332 ... The ControlPanel problem should be fixed here now. I did not update my wikilabs-plugins yet

@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

Of course, these are the things becoming mainstream now; it's hard to predict what the next UI trend will be, but I think layered dimensionality and thin borders are here to stay.

You are right. I am OK with thin borders, ... but they make it harder for users with "limited" eye sight. ... Or even you wear glasses.

The whole accessibility issue is a big thing.

The Audit: Palette Test Page allows to switch palettes and see, what happens to the elements below.

This Page will be part of my PaletteManager Plugin in the future, to test light, dark and new palettes much faster.

We have a big contrast problem in our UI, which I try to tackle from time to time, with "baby step" PRs ...

I try to make it much easier to improve contrast settings for as many palettes as possible at the same time ...

@pmario

pmario commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

On the other hand there is a pending PR from Jeremy, which should be merged into v5.5.0-prerelease as soon as v5.4.1 is released.

Hopefully it will help us to improve the accessibility contrast settings ... We will see.

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.

5 participants