Skip to content

Commit

Permalink
feat(core): ✨ switch all icons to OOUI module
Browse files Browse the repository at this point in the history
Custom icons are no longer needed. This should reduce
an extra ResourceLoader module registration.
  • Loading branch information
alistair3149 committed May 6, 2024
1 parent a81bf1f commit 58bab74
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 44 deletions.
4 changes: 0 additions & 4 deletions resources/skins.citizen.icons/backToTop.svg

This file was deleted.

7 changes: 0 additions & 7 deletions resources/skins.citizen.icons/wmui/collapse.svg

This file was deleted.

4 changes: 0 additions & 4 deletions resources/skins.citizen.icons/wmui/edit.svg

This file was deleted.

22 changes: 3 additions & 19 deletions resources/skins.citizen.styles/components/TableOfContents.less
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.citizen-toc {
--size-icon: 1rem;
font-size: var( --font-size-small );
line-height: var( --line-height-xs );

Expand All @@ -9,20 +10,8 @@
}

&__top {
&::before {
width: 0.875rem;
height: 0.875rem;
content: '';
filter: var( --filter-invert );
opacity: var( --opacity-icon-base );
}

&:hover::before {
opacity: var( --opacity-icon-base--hover );
}

&:active::before {
opacity: var( --opacity-icon-base--hover );
.citizen-ui-icon {
transform: rotate( 90deg );
}
}

Expand Down Expand Up @@ -183,11 +172,6 @@
transform: none;
transform-origin: bottom left;

.citizen-ui-icon {
width: 1rem;
height: 1rem;
}

// The hover state colors are not great but it will do for now
&:hover {
background-color: var( --color-surface-3 );
Expand Down
12 changes: 2 additions & 10 deletions skin.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
],
"styles": [
"skins.citizen.styles",
"skins.citizen.icons",
"skins.citizen.icons.wmui"
"skins.citizen.icons"
],
"messages": [
"citizen-actions-more-toggle",
Expand Down Expand Up @@ -278,14 +277,6 @@
]
},
"skins.citizen.icons": {
"class": "MediaWiki\\ResourceLoader\\ImageModule",
"selector": "{name}",
"defaultColor": "#000",
"images": {
".citizen-toc__top:before": "resources/skins.citizen.icons/backToTop.svg"
}
},
"skins.citizen.icons.wmui": {
"selectorWithoutVariant": ".mw-ui-icon-wikimedia-{name}:before",
"useDataURI": false,
"defaultColor": "#000",
Expand All @@ -305,6 +296,7 @@
"edit",
"editLock",
"ellipsis",
"first",
"help",
"history",
"home",
Expand Down
1 change: 1 addition & 0 deletions templates/TableOfContents.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</label>
<nav id="mw-panel-toc" class="citizen-toc__card citizen-menu-checkbox-target" role="navigation" aria-labelledby="mw-panel-toc-label">
<a class="citizen-toc__top citizen-toc__link" title="{{html-citizen-jumptotop}}" href="#top">
<div class="citizen-ui-icon mw-ui-icon-first mw-ui-icon-wikimedia-first"></div>
<div class="citizen-toc__text">{{msg-citizen-jumptotop}}</div>
</a>
<div class="citizen-toc__header">{{msg-toc}}</div>
Expand Down

0 comments on commit 58bab74

Please sign in to comment.