From dc7f2a57bb60188cf428d6304471427fa06c9e84 Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Tue, 7 Oct 2025 18:55:26 +0800 Subject: [PATCH] Use currentColor to style svg (#9316) * Replace fill: with currentColor * Remove fill from wikitext * Replace fill property with color property for svg selectors * Further remove fill property * Replace more fill properties * Replace fill in seamless theme * Replace fill in plugins --- core/ui/EditTemplate/tags.tid | 6 +- core/ui/ViewTemplate/title.tid | 2 +- core/wiki/macros/tag.tid | 1 - core/wiki/macros/thumbnails.tid | 2 +- plugins/tiddlywiki/comments/styles.tid | 2 +- plugins/tiddlywiki/menubar/styles.tid | 16 +-- plugins/tiddlywiki/text-slicer/styles.tid | 2 +- .../tour/simplified-tiddler-with-tags.tid | 1 - plugins/tiddlywiki/tour/styles.tid | 5 +- plugins/tiddlywiki/upgrade/styles.tid | 4 +- themes/tiddlywiki/seamless/base.tid | 2 +- themes/tiddlywiki/vanilla/base.tid | 108 ++++++++---------- 12 files changed, 60 insertions(+), 91 deletions(-) diff --git a/core/ui/EditTemplate/tags.tid b/core/ui/EditTemplate/tags.tid index bbd3d301e..298120606 100644 --- a/core/ui/EditTemplate/tags.tid +++ b/core/ui/EditTemplate/tags.tid @@ -17,13 +17,11 @@ tags: $:/tags/EditTemplate <$let backgroundColor=<> > > - style=`color:$(foregroundColor)$; fill:$(foregroundColor)$; background-color:$(backgroundColor)$;` + style=`color:$(foregroundColor)$; background-color:$(backgroundColor)$;` > <$transclude tiddler=<>/> <$view field="title" format="text"/> - <$button class="tc-btn-invisible tc-remove-tag-button" - style.fill=<> - > + <$button class="tc-btn-invisible tc-remove-tag-button"> <$action-listops $tiddler=<> $field=<> $subfilter="-[{!!title}]"/> {{$:/core/images/close-button}} diff --git a/core/ui/ViewTemplate/title.tid b/core/ui/ViewTemplate/title.tid index b2cf1bd8e..56b92efe8 100644 --- a/core/ui/ViewTemplate/title.tid +++ b/core/ui/ViewTemplate/title.tid @@ -2,7 +2,7 @@ title: $:/core/ui/ViewTemplate/title tags: $:/tags/ViewTemplate \whitespace trim -\define title-styles() fill:$(foregroundColor)$; +\define title-styles() color:$(foregroundColor)$;
diff --git a/core/wiki/macros/tag.tid b/core/wiki/macros/tag.tid index 2c539b42e..142403602 100644 --- a/core/wiki/macros/tag.tid +++ b/core/wiki/macros/tag.tid @@ -3,7 +3,6 @@ tags: $:/tags/Macro \define tag-pill-styles() background-color:$(backgroundColor)$; -fill:$(foregroundColor)$; color:$(foregroundColor)$; \end diff --git a/core/wiki/macros/thumbnails.tid b/core/wiki/macros/thumbnails.tid index 213b6520c..83e03b906 100644 --- a/core/wiki/macros/thumbnails.tid +++ b/core/wiki/macros/thumbnails.tid @@ -21,7 +21,7 @@ tags: $:/tags/Macro style="width:$width$px;height:$height$px;background-color:$background-color$;" >
$icon$
$caption$
\end diff --git a/plugins/tiddlywiki/comments/styles.tid b/plugins/tiddlywiki/comments/styles.tid index ed3cf1ddf..62b34c764 100644 --- a/plugins/tiddlywiki/comments/styles.tid +++ b/plugins/tiddlywiki/comments/styles.tid @@ -25,7 +25,7 @@ tags: [[$:/tags/Stylesheet]] } .tc-comment-button button svg { - fill: <>; + color: <>; height: 2em; width: 2em; } diff --git a/plugins/tiddlywiki/menubar/styles.tid b/plugins/tiddlywiki/menubar/styles.tid index 26a96be01..39ec6c626 100644 --- a/plugins/tiddlywiki/menubar/styles.tid +++ b/plugins/tiddlywiki/menubar/styles.tid @@ -87,8 +87,6 @@ nav.tc-menubar li.tc-menubar-item > button { font-weight: 700; color: <>; color: <>; - fill: <>; - fill: <>; text-decoration: none; padding: 0.5em; margin: 0; @@ -105,16 +103,14 @@ nav.tc-menubar li.tc-menubar-item > button.tc-selected { background: <>; color: <>; color: <>; - fill: <>; - fill: <>; } nav.tc-menubar li.tc-menubar-item svg { transition: none; width: 1em; height: 1em; - fill: <>; - fill: <>; + color: <>; + color: <>; } nav.tc-menubar li.tc-menubar-item .tc-menubar-dropdown-arrow svg { @@ -124,8 +120,8 @@ nav.tc-menubar li.tc-menubar-item .tc-menubar-dropdown-arrow svg { nav.tc-menubar li.tc-menubar-item > a.tc-selected svg, nav.tc-menubar li.tc-menubar-item > button.tc-selected svg { - fill: <>; - fill: <>; + color: <>; + color: <>; } nav.tc-menubar li.tc-menubar-item > a:hover, @@ -135,8 +131,6 @@ nav.tc-menubar li.tc-menubar-item > button:hover { background: <>; color: <>; color: <>; - fill: <>; - fill: <>; border-radius: 0; text-decoration: none; } @@ -148,8 +142,6 @@ nav.tc-menubar li.tc-menubar-item > button:active { background: <>; color: <>; color: <>; - fill: <>; - fill: <>; border-radius: 0; text-decoration: none; } diff --git a/plugins/tiddlywiki/text-slicer/styles.tid b/plugins/tiddlywiki/text-slicer/styles.tid index 370b4d684..328486c81 100644 --- a/plugins/tiddlywiki/text-slicer/styles.tid +++ b/plugins/tiddlywiki/text-slicer/styles.tid @@ -96,7 +96,7 @@ div.tc-edit-template-document-tiddler-heading a:hover { .tc-view-template-document-tiddler-heading-icon svg, .tc-edit-template-document-tiddler-heading-icon svg { - fill: <>; + color: <>; } .tc-view-template-document-tiddler { diff --git a/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid b/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid index c2c14a7b0..c5f27662c 100644 --- a/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid +++ b/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid @@ -3,7 +3,6 @@ title: $:/plugins/tiddlywiki/tour/simplified-tiddler-with-tags \whitespace trim \define tag-pill-styles() background-color:$(backgroundColor)$; -fill:$(foregroundColor)$; color:$(foregroundColor)$; \end diff --git a/plugins/tiddlywiki/tour/styles.tid b/plugins/tiddlywiki/tour/styles.tid index 7bb434dab..1a9bf871b 100644 --- a/plugins/tiddlywiki/tour/styles.tid +++ b/plugins/tiddlywiki/tour/styles.tid @@ -66,7 +66,6 @@ tags: $:/tags/Stylesheet .tc-tour-panel-controls .tc-tour-panel-list-button.tc-selected { color: <>; - fill: <>; background: <>; } @@ -104,7 +103,6 @@ tags: $:/tags/Stylesheet border-radius: 1em; background: <>; color: <>; - fill: <>; text-transform: uppercase; } @@ -167,7 +165,7 @@ tags: $:/tags/Stylesheet } .tc-tour-task svg { - fill: <>; + color: <>; vertical-align: middle; width: 1.2em; height: 1.2em; @@ -240,7 +238,6 @@ tags: $:/tags/Stylesheet .tc-tour-settings-tour-step-launch-button:hover { background: <>; color: <>; - fill: <>; } .tc-tour-settings-tour-step-heading-step-number { diff --git a/plugins/tiddlywiki/upgrade/styles.tid b/plugins/tiddlywiki/upgrade/styles.tid index 944c6a918..d6b880be1 100644 --- a/plugins/tiddlywiki/upgrade/styles.tid +++ b/plugins/tiddlywiki/upgrade/styles.tid @@ -20,11 +20,11 @@ tags: $:/tags/Stylesheet .tc-upgrade-wizard svg.tc-image-download-button { width: 14em; height: 14em; - fill: <>; + color: <>; } .tc-upgrade-wizard:hover svg.tc-image-download-button { - fill: <>; + color: <>; } .tc-upgrade-wizard svg .tc-image-download-button-ring { diff --git a/themes/tiddlywiki/seamless/base.tid b/themes/tiddlywiki/seamless/base.tid index 21656aa9e..0f07c3529 100644 --- a/themes/tiddlywiki/seamless/base.tid +++ b/themes/tiddlywiki/seamless/base.tid @@ -94,7 +94,7 @@ html:-webkit-full-screen { /* Adjust the colour of the page controls */ body.tc-body .tc-page-controls svg { - fill: <>; + color: <>; } /* Adjust the colour of the sidebar selected tabs */ diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 7cd6f6e5b..a7cc9e549 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -93,7 +93,6 @@ button:-moz-focusring, input:-moz-focusring, textarea:-moz-focusring, select:-mo html button { line-height: 1.2; color: <>; - fill: <>; background: <>; border-color: <>; cursor: pointer; @@ -104,10 +103,6 @@ button:disabled { color: <>; } -button:disabled svg { - fill: <>; -} - /* ** Basic element styles */ @@ -130,7 +125,7 @@ body.tc-body { <> color: <>; background-color: <>; - fill: <>; + fill: currentColor; } <>; + color: <>; } /* @@ -608,7 +603,6 @@ button svg, button img, label svg, label img { border: none; cursor: pointer; color: <>; - fill: <>; } button:disabled.tc-btn-invisible { @@ -634,10 +628,6 @@ html body.tc-body .tc-btn-boxed svg { color: <>; } -html body.tc-body .tc-btn-boxed:hover svg { - fill: <>; -} - .tc-btn-rounded { font-size: 0.5em; line-height: 2; @@ -651,7 +641,7 @@ html body.tc-body .tc-btn-boxed:hover svg { html body.tc-body .tc-btn-rounded svg { font-size: 1.6666em; - fill: <>; + color: <>; } .tc-btn-rounded:hover { @@ -660,14 +650,10 @@ html body.tc-body .tc-btn-rounded svg { color: <>; } -html body.tc-body .tc-btn-rounded:hover svg { - fill: <>; -} - .tc-btn-icon svg { height: 1em; width: 1em; - fill: <>; + color: <>; } @@ -691,7 +677,6 @@ html body.tc-body .tc-btn-rounded:hover svg { margin: 4px 8px 4px 8px; background: <>; color: <>; - fill: <>; border: none; border-radius: 2px; font-size: 1.2em; @@ -704,7 +689,6 @@ html body.tc-body .tc-btn-rounded:hover svg { height: 2em; width: 2em; vertical-align: middle; - fill: <>; } .tc-primary-btn { @@ -717,7 +701,6 @@ html body.tc-body .tc-btn-rounded:hover svg { .tc-sidebar-lists button { color: <>; - fill: <>; } .tc-sidebar-lists button.tc-btn-mini { @@ -758,11 +741,11 @@ button svg.tc-image-button, button .tc-image-button img { .tc-unfold-banner svg, .tc-fold-banner svg { height: 0.75em; - fill: <>; + color: <>; } .tc-unfold-banner:hover svg, .tc-fold-banner:hover svg { - fill: <>; + color: <>; } .tc-fold-banner { @@ -917,11 +900,11 @@ button.tc-btn-invisible.tc-remove-tag-button { } .tc-topbar svg { - fill: <>; + color: <>; } .tc-topbar button:hover svg { - fill: <>; + color: <>; } @media (max-width: <>) { @@ -934,7 +917,6 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-sidebar-header { color: <>; - fill: <>; } .tc-sidebar-header .tc-title a.tc-tiddlylink-resolves { @@ -984,11 +966,11 @@ button.tc-btn-invisible.tc-remove-tag-button { } .tc-page-controls svg { - fill: <>; + color: <>; } .tc-page-controls button:hover svg, .tc-page-controls a:hover svg { - fill: <>; + color: <>; } .tc-sidebar-lists .tc-menu-list-item { @@ -1274,7 +1256,7 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-tiddler-controls button svg, .tc-tiddler-controls button img, .tc-search button svg, .tc-search a svg { - fill: <>; + color: <>; } .tc-tiddler-controls button svg, .tc-tiddler-controls button img { @@ -1289,12 +1271,12 @@ button.tc-btn-invisible.tc-remove-tag-button { .tc-tiddler-controls button.tc-selected svg, .tc-page-controls button.tc-selected svg { - fill: <>; + color: <>; } .tc-tiddler-controls button.tc-btn-invisible:hover svg, .tc-search button:hover svg, .tc-search a:hover svg { - fill: <>; + color: <>; } @media print { @@ -1422,7 +1404,6 @@ html body.tc-body.tc-single-tiddler-window { vertical-align: middle; background-color: <>; color: <>; - fill: <>; border-radius: 4px; padding: 3px; margin: 2px 0 2px 4px; @@ -1453,7 +1434,6 @@ html body.tc-body.tc-single-tiddler-window { .tc-editor-toolbar button:hover { background-color: <>; - fill: <>; color: <>; } @@ -1534,43 +1514,43 @@ html body.tc-body.tc-single-tiddler-window { */ .tc-page-controls svg.tc-image-new-button { - fill: <>; + color: <>; } .tc-page-controls svg.tc-image-options-button { - fill: <>; + color: <>; } .tc-page-controls svg.tc-image-save-button { - fill: <>; + color: <>; } .tc-tiddler-controls button svg.tc-image-info-button { - fill: <>; + color: <>; } .tc-tiddler-controls button svg.tc-image-edit-button { - fill: <>; + color: <>; } .tc-tiddler-controls button svg.tc-image-close-button { - fill: <>; + color: <>; } .tc-tiddler-controls button svg.tc-image-delete-button { - fill: <>; + color: <>; } .tc-tiddler-controls button svg.tc-image-cancel-button { - fill: <>; + color: <>; } .tc-tiddler-controls button svg.tc-image-done-button { - fill: <>; + color: <>; } .tc-page-controls svg.tc-image-layout-button { - fill: <>; + color: <>; } /* @@ -1710,7 +1690,7 @@ html body.tc-body.tc-single-tiddler-window { .tc-edit-field-remove svg { height: 1em; width: 1em; - fill: <>; + color: <>; vertical-align: middle; } @@ -1824,7 +1804,7 @@ html body.tc-body.tc-single-tiddler-window { .tc-btn-dropdown svg, .tc-btn-dropdown img { height: 1em; width: 1em; - fill: <>; + color: <>; } .tc-drop-down-wrapper { @@ -1847,15 +1827,15 @@ html body.tc-body.tc-single-tiddler-window { } .tc-drop-down button svg, .tc-drop-down a svg { - fill: <>; + color: <>; } .tc-drop-down button:disabled svg { - fill: <>; + color: <>; } .tc-drop-down button.tc-btn-invisible:hover svg { - fill: <>; + color: <>; } .tc-drop-down .tc-drop-down-info { @@ -2342,7 +2322,6 @@ html body.tc-body.tc-single-tiddler-window { .tc-manager-list-item-heading-selected { font-weight: bold; color: <>; - fill: <>; background-color: <>; } @@ -2469,7 +2448,7 @@ html body.tc-body.tc-single-tiddler-window { } .tc-alert-toolbar svg { - fill: <>; + color: <>; } .tc-alert-subtitle { @@ -2526,14 +2505,12 @@ html body.tc-body.tc-single-tiddler-window { border-bottom: none; background: <>; color: <>; - fill: <>; } .tc-drafts-list a:hover { text-decoration: none; background: <>; color: <>; - fill: <>; } .tc-drafts-list a svg { @@ -2562,13 +2539,16 @@ html body.tc-body.tc-single-tiddler-window { display: flex; text-shadow: none; border: 1px solid <>; - fill: <>; background-color: <>; margin: 0.5em 0 0.5em 0; padding: 4px; align-items: center; } +.tc-plugin-info svg { + color: <>; +} + .tc-sidebar-lists a.tc-tiddlylink.tc-plugin-info { color: <>; } @@ -2610,11 +2590,14 @@ a.tc-tiddlylink.tc-plugin-info:hover { text-decoration: none; background-color: <>; color: <>; - fill: <>; +} + +a.tc-tiddlylink.tc-plugin-info:hover svg { + color: <>; } a.tc-tiddlylink.tc-plugin-info:hover > .tc-plugin-info-chunk > svg { - fill: <>; + color: <>; } a.tc-tiddlylink.tc-plugin-info:hover > .tc-plugin-info-chunk .tc-plugin-info-stability { @@ -2738,7 +2721,6 @@ a.tc-tiddlylink.tc-plugin-info:hover > .tc-plugin-info-chunk .tc-plugin-info-sta font-weight: bold; background: green; color: white; - fill: white; border-radius: 4px; padding: 3px; } @@ -2927,7 +2909,7 @@ input.tc-palette-manager-colour-input { width: 0.7em; height: 0.7em; vertical-align: middle; - fill: <>; + color: <>; } .tc-table-of-contents ol { @@ -3050,7 +3032,6 @@ html body.tc-dirty svg.tc-image-save-button-dynamic .tc-image-save-button-dynami } html body.tc-dirty span.tc-dirty-indicator, html body.tc-dirty span.tc-dirty-indicator svg { - fill: <>; color: <>; } @@ -3137,7 +3118,7 @@ html body.tc-dirty span.tc-dirty-indicator, html body.tc-dirty span.tc-dirty-ind .tc-thumbnail-wrapper:hover .tc-thumbnail-icon svg, .tc-thumbnail-wrapper:hover .tc-thumbnail-icon img { - fill: #fff; + color: #fff; <> } @@ -3244,7 +3225,7 @@ html body.tc-dirty span.tc-dirty-indicator, html body.tc-dirty span.tc-dirty-ind } .tc-tree svg { - fill: #acacac; + color: #acacac; } .tc-tree span svg { @@ -3361,7 +3342,6 @@ span.tc-translink > a:first-child { } .tc-test-case-result-icon { - fill: #fff; padding: 0.25em; display: inline-block; line-height: 0; @@ -3370,6 +3350,10 @@ span.tc-translink > a:first-child { margin-right: 0.25em; } +.tc-test-case-result-icon svg { + color: #fff; +} + .tc-test-case-result-icon-pass { background-color: green; } @@ -3403,7 +3387,7 @@ span.tc-translink > a:first-child { } .tc-test-case-toolbar svg { - fill: <>; + color: <>; } .tc-test-case-toolbar .tc-drop-down {