Skip to content

Commit

Permalink
refactor(cssVar): ♻️ introduce color-inverted
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Jun 5, 2024
1 parent 5d990f8 commit 3d146b2
Show file tree
Hide file tree
Showing 27 changed files with 67 additions and 66 deletions.
4 changes: 2 additions & 2 deletions resources/mixins.less
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@

// Button Styles
.button-blue() {
color: #fff !important;
color: var( --color-inverted ) !important;
background-color: var( --color-primary );
}

Expand All @@ -186,7 +186,7 @@
}

.button-red() {
color: #fff !important;
color: var( --color-inverted ) !important;
background-color: var( --color-destructive );
}

Expand Down
1 change: 1 addition & 0 deletions resources/skins.citizen.styles/common/cssvariables.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
--color-primary__h: @color-primary__h;
--color-primary__s: @color-primary__s;
--color-primary__l: @color-primary__l;
--color-inverted: #fff;

--color-surface-0__s: 30%;
--color-surface-0__l: 96%;
Expand Down
4 changes: 2 additions & 2 deletions resources/skins.citizen.styles/components/Pagetools.less
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
display: block;
padding: 0.1em 0.4em;
font-size: 0.65rem;
color: #fff;
color: var( --color-inverted );
content: attr( data-counter-text );
background: var( --color-primary );
border-radius: var( --border-radius--pill );
Expand All @@ -95,7 +95,7 @@
#ca-edit,
#ca-ve-edit {
> a {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary );

&:hover {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ figure[ typeof~='mw:File/Frame' ] {
border: 1px solid var( --border-color-interactive );

&:hover {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--hover );
}

&:active {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--active );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@
border: 1px solid var( --border-color-interactive );

&:hover {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--hover );
}

&:active {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--active );
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
border-radius: var( --border-radius--pill );

&:hover {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--hover );
}

Expand Down
12 changes: 6 additions & 6 deletions skinStyles/codex/codex.styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
.cdx-button--type-primary.cdx-button--action-progressive:enabled:focus:not( :active ),
.cdx-button--weight-primary.cdx-button--action-progressive:enabled:focus:not( :active ) {
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-inverted );
}

.cdx-button--type-primary.cdx-button--action-destructive:enabled,
Expand All @@ -98,7 +98,7 @@
.cdx-button--type-primary.cdx-button--action-destructive:enabled:focus:not( :active ),
.cdx-button--weight-primary.cdx-button--action-destructive:enabled:focus:not( :active ) {
border-color: var( --color-destructive );
box-shadow: inset 0 0 0 1px var( --color-destructive ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-destructive ), inset 0 0 0 2px var( --color-inverted );
}

.cdx-button--type-normal.cdx-button--action-progressive:enabled,
Expand Down Expand Up @@ -234,7 +234,7 @@

.cdx-card--is-link:focus {
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-inverted );
}

.cdx-card__text {
Expand Down Expand Up @@ -307,7 +307,7 @@

.cdx-checkbox__input:enabled:checked:focus:not( :active ) + .cdx-checkbox__icon,
.cdx-checkbox__input:enabled:indeterminate:focus:not( :active ) + .cdx-checkbox__icon {
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-inverted );
}

.cdx-checkbox__input:disabled + .cdx-checkbox__icon {
Expand Down Expand Up @@ -520,7 +520,7 @@
}

.cdx-radio__input:enabled:checked + .cdx-radio__icon {
background-color: #fff;
background-color: var( --color-inverted );
border-color: var( --color-primary );
}

Expand Down Expand Up @@ -746,7 +746,7 @@

.cdx-toggle-button--framed.cdx-toggle-button--toggled-on:enabled:focus {
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-inverted );
}

.cdx-toggle-button--framed.cdx-toggle-button--toggled-on:enabled:active {
Expand Down
4 changes: 2 additions & 2 deletions skinStyles/extensions/AJAXPoll/ext.ajaxpoll.less
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
}

.ajaxpoll .ajaxpoll-hover-vote {
color: #fff;
color: var( --color-inverted );
background: var( --color-destructive );
}

Expand Down Expand Up @@ -93,7 +93,7 @@
}

.ajaxpoll .ajaxpoll-checkevent {
color: #fff;
color: var( --color-inverted );
background: var( --color-success );
}

Expand Down
2 changes: 1 addition & 1 deletion skinStyles/extensions/CodeEditor/ext.codeEditor.ace.less
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@
}

&[ ace_selected_button='true' ] {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary );
border-color: var( --color-primary );
box-shadow: none;
Expand Down
2 changes: 1 addition & 1 deletion skinStyles/extensions/Echo/ext.echo.styles.badge.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
}

&:focus {
box-shadow: 0 0 0 1px #fff, 0 0 0 3px var( --color-primary );
box-shadow: 0 0 0 1px var( --color-inverted ), 0 0 0 3px var( --color-primary );
opacity: var( --opacity-icon-base--active );

&::after {
Expand Down
14 changes: 7 additions & 7 deletions skinStyles/extensions/MediaSearch/mediasearch.styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
}

&.sd-button--framed {
color: #fff;
color: var( --color-inverted );

&:hover {
border-color: var( --color-primary--hover );
Expand Down Expand Up @@ -153,7 +153,7 @@
}

&.sd-button--framed {
color: #fff;
color: var( --color-inverted );

&:hover {
border-color: var( --color-destructive--hover );
Expand Down Expand Up @@ -188,7 +188,7 @@

&:focus {
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-inverted );
}

&.sd-button--destructive {
Expand All @@ -208,7 +208,7 @@

&:focus {
border-color: var( --color-destructive );
box-shadow: inset 0 0 0 1px var( --color-destructive ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-destructive ), inset 0 0 0 2px var( --color-inverted );
}
}
}
Expand Down Expand Up @@ -287,7 +287,7 @@
&:checked:enabled:focus + .sd-checkbox__icon {
background-color: var( --color-primary );
border-color: var( --color-primary );
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px #fff;
box-shadow: inset 0 0 0 1px var( --color-primary ), inset 0 0 0 2px var( --color-inverted );
}

&:checked:enabled:hover + .sd-checkbox__icon {
Expand Down Expand Up @@ -406,7 +406,7 @@
}

&:checked + .sd-radio__icon {
background-color: #fff;
background-color: var( --color-inverted );
border-color: var( --color-primary );
}

Expand All @@ -421,7 +421,7 @@
}

&:checked + .sd-radio__icon {
background-color: #fff;
background-color: var( --color-inverted );
}
}

Expand Down
2 changes: 1 addition & 1 deletion skinStyles/extensions/MultimediaViewer/mmv.less
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@
// Only apply background color when scroll up
.mw-mmv-post-image {
min-height: @mmv-height-abovethefold;
color: #fff;
color: var( --color-inverted );
background-color: transparent;
border-top-left-radius: var( --border-radius--large );
border-top-right-radius: var( --border-radius--large );
Expand Down
2 changes: 1 addition & 1 deletion skinStyles/extensions/Scribunto/ext.scribunto.edit.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
padding: var( --space-xs ) var( --space-sm );
margin: var( --space-xs ) 0;
font-weight: var( --font-weight-medium );
color: #fff;
color: var( --color-inverted );
cursor: pointer;
background-color: var( --color-destructive );
border-radius: var( --border-radius--small );
Expand Down
8 changes: 4 additions & 4 deletions skinStyles/extensions/SemanticMediaWiki/ext.jquery.atwho.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
/*
* Citizen
*
* SkinStyles for Extension:SemanticMediaWiki
* Module: ext.jquery.atwho
* Version: 4.0.2 (0fcdfce)
*
* Date: 2022-10-20
* Date: 2022-10-20
*/

/* jquery/jquery.atwho.css */
Expand All @@ -27,7 +27,7 @@
}

.atwho-view .cur {
color: #fff;
color: var( --color-inverted );
background: var( --color-primary );
}

Expand All @@ -36,7 +36,7 @@
}

.atwho-view .cur strong {
color: #fff;
color: var( --color-inverted );
}

.atwho-view ul li {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ div#ask legend {
padding: var( --space-md );
font-size: var( --font-size-small );
font-weight: var( --font-weight-medium );
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary );
border-color: var( --color-primary );
border-radius: var( --border-radius--medium );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}

.smw-ui-pagination .page-link.link-active {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary );
border-color: var( --color-primary );
}
Expand Down
12 changes: 6 additions & 6 deletions skinStyles/extensions/SemanticMediaWiki/ext.smw.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,20 @@ a.smw-ask-action-btn-lgrey:active,

.smw-ask-action-btn-lblue,
a.smw-ask-action-btn-lblue:visited {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary );
border-color: var( --color-primary );
}

a.smw-ask-action-btn-lblue:hover {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--hover );
border-color: var( --color-primary--hover );
}

// Added active state
a.smw-ask-action-btn-lblue:active {
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--active );
border-color: var( --color-primary--active );
}
Expand Down Expand Up @@ -632,7 +632,7 @@ a.smw-ask-action-btn-lblue:active {
.smw-indicator-accordion-tab .smw-indicator-accordion-tab-label {
border-top: 1px solid #ebebeb;
border-bottom: 0px solid #fff;
border-bottom: 0px solid var( --color-inverted );
}
.smw-indicator-accordion-tab-close:hover {
Expand All @@ -641,11 +641,11 @@ a.smw-ask-action-btn-lblue:active {
input:checked + .smw-indicator-accordion-tab-label {
background: #333;
color: #fff;
color: var( --color-inverted );
}
input:checked + .smw-indicator-accordion-tab-label::after {
color: #fff;
color: var( --color-inverted );
width: 20px;
margin-top: 2px;
-webkit-transform: rotate(90deg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

&:hover,
&:active {
color: #fff;
color: var( --color-inverted );
}
}

Expand Down Expand Up @@ -86,7 +86,7 @@

&.mw-pt-languages-selected {
font-weight: var( --font-weight-normal );
color: #fff;
color: var( --color-inverted );
background-color: var( --color-primary--active );
}
}
Expand Down
4 changes: 2 additions & 2 deletions skinStyles/extensions/VisualEditor/ext.visualEditor.core.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
/*
.ve-ce-alienNode-highlights .ve-ce-focusableNode-highlight {
// background-color: #95d14f;
// background-image: repeating-linear-gradient( -45deg, #fff 0, #fff 5px, #95d14f 5px, #95d14f 10px );
// background-image: repeating-linear-gradient( -45deg, var( --color-inverted ) 0, var( --color-inverted ) 5px, #95d14f 5px, #95d14f 10px );
}
.ve-ce-surface-highlights-focused .ve-ce-alienNode-highlights .ve-ce-focusableNode-highlight {
Expand Down Expand Up @@ -151,7 +151,7 @@
.ve-ce-surface-highlights-user-cursor-label {
font-weight: bold;
background: #a66;
color: #fff;
color: var( --color-inverted );
text-shadow: 0 0 1px #000;
}
*/
Expand Down
Loading

0 comments on commit 3d146b2

Please sign in to comment.