Skip to content

Commit

Permalink
feat(core)!: 💥 ✨ rework font-size CSS variables
Browse files Browse the repository at this point in the history
To align with Codex tokens, the old --font-size-hN CSS variables are renamed.
Introduced new font size variables (x-small, small)
  • Loading branch information
alistair3149 committed Feb 26, 2024
1 parent 23ec5e6 commit a9acc08
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 40 deletions.
21 changes: 11 additions & 10 deletions resources/skins.citizen.styles/common/cssvariables.less
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@
--font-family-language-serif: '';
--font-family-language-monospace: '';

--font-size-h1: 1.75rem;
--font-size-h2: 1.375rem;
--font-size-h3: 1.125rem;
--font-size-h4: 1rem;
--font-size-h5: 1rem;
--font-size-h6: 1rem;
--font-size-x-small: 0.75rem;
--font-size-small: 0.875rem;
--font-size-medium: 1rem;
--font-size-large: 1rem;
--font-size-x-large: 1.125rem;
--font-size-xx-large: 1.375rem;
--font-size-xxx-large: 1.75rem;

--font-weight-normal: 400;
--font-weight-medium: ~'calc( var( --font-weight-normal ) + 100)';
Expand Down Expand Up @@ -167,10 +168,10 @@ html {

@media ( min-width: @min-width-breakpoint-tablet ) {
:root {
--font-size-h1: 2rem;
--font-size-h2: 1.5rem;
--font-size-h3: 1.25rem;
--font-size-h4: 1.125rem;
--font-size-large: 1.125rem;
--font-size-x-large: 1.25rem;
--font-size-xx-large: 1.5rem;
--font-size-xxx-large: 2rem;
}

html {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}

&-parenthesis {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
color: var( --color-base--subtle );
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

.firstHeading {
overflow: hidden;
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
text-overflow: ellipsis;
}

Expand Down
12 changes: 6 additions & 6 deletions resources/skins.citizen.styles/skinning/elements.less
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,27 @@ h6 {
}

h1 {
font-size: var( --font-size-h1 );
font-size: var( --font-size-xxx-large );
}

h2 {
font-size: var( --font-size-h2 );
font-size: var( --font-size-xx-large );
}

h3 {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
}

h4 {
font-size: var( --font-size-h4 );
font-size: var( --font-size-large );
}

h5 {
font-size: var( --font-size-h5 );
font-size: var( --font-size-medium );
}

h6 {
font-size: var( --font-size-h6 );
font-size: var( --font-size-medium );
}

p {
Expand Down
2 changes: 1 addition & 1 deletion skinStyles/extensions/Cargo/ext.cargo.pagevalues.less
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
// Tweak size to look more like other sticky header
h2 {
margin: 0;
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
}
}
2 changes: 1 addition & 1 deletion skinStyles/extensions/Echo/ext.echo.special.less
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
border-radius: var( --border-radius--medium );

&-title {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
font-weight: var( --font-weight-semibold );
color: var( --color-base--emphasized );
}
Expand Down
8 changes: 4 additions & 4 deletions skinStyles/extensions/MediaSearch/mediasearch.styles.less
Original file line number Diff line number Diff line change
Expand Up @@ -869,18 +869,18 @@

/* EmptyState.less */
.sdms-empty-state {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
}

/* NoResults.less */
.sdms-no-results {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
font-weight: var( --font-weight-semibold );
}

/* EndOfResults.less */
.sdms-end-of-results {
font-size: var( --font-size-h6 );
font-size: var( --font-size-medium );
font-weight: var( --font-weight-semibold );
color: var( --color-base--emphasized );
}
Expand Down Expand Up @@ -999,6 +999,6 @@

/* SearchError.less */
.sdms-error {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
font-weight: var( --font-weight-semibold );
}
2 changes: 1 addition & 1 deletion skinStyles/extensions/UploadWizard/ext.uploadWizard.less
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

/* uw.ui.Metadata.less */
h3.mwe-upwiz-metadata-title {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
}

.mwe-upwiz-metadata-booklet.oo-ui-bookletLayout {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@
}

&-heading1 .oo-ui-tool-title {
font-size: var( --font-size-h1 );
font-size: var( --font-size-xxx-large );
}

&-heading2 .oo-ui-tool-title {
font-size: var( --font-size-h2 );
font-size: var( --font-size-xx-large );
}

&-heading3 .oo-ui-tool-title {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
}

&-heading4 .oo-ui-tool-title {
font-size: var( --font-size-h4 );
font-size: var( --font-size-large );
}

&-heading5 .oo-ui-tool-title {
font-size: var( --font-size-h5 );
font-size: var( --font-size-medium );
}

&-heading6 .oo-ui-tool-title {
font-size: var( --font-size-h6 );
font-size: var( --font-size-medium );
}

&-preformatted .oo-ui-tool-title {
Expand Down
8 changes: 4 additions & 4 deletions skinStyles/extensions/WikiEditor/ext.wikiEditor.less
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,22 @@
}

&[ rel='heading-2' ] {
font-size: var( --font-size-h2 );
font-size: var( --font-size-xx-large );
font-weight: var( --font-weight-semibold );
}

&[ rel='heading-3' ] {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
font-weight: var( --font-weight-semibold );
}

&[ rel='heading-4' ] {
font-size: var( --font-size-h4 );
font-size: var( --font-size-large );
font-weight: var( --font-weight-semibold );
}

&[ rel='heading-5' ] {
font-size: var( --font-size-h5 );
font-size: var( --font-size-medium );
font-weight: var( --font-weight-semibold );
}
}
Expand Down
2 changes: 1 addition & 1 deletion skinStyles/extensions/WikiHiero/ext.wikihiero.less
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
background: var( --color-surface-0 );

@media screen and ( min-width: @min-width-breakpoint-tablet ) {
top: ~'calc( var( --line-height-xs ) * var( --font-size-h3 ) + 2 * var( --space-md ) )';
top: ~'calc( var( --line-height-xs ) * var( --font-size-x-large ) + 2 * var( --space-md ) )';
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
padding: var( --space-md ) 0;

a {
font-size: var( --font-size-h3 );
font-size: var( --font-size-x-large );
}
}
}
Expand All @@ -121,7 +121,7 @@

&-heading {
a {
// font-size: var( --font-size-h3 );
// font-size: var( --font-size-x-large );
font-weight: var( --font-weight-semibold );
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

h2 {
max-width: 20rem;
font-size: var( --font-size-h1 );
font-size: var( --font-size-xxx-large );
}
}

Expand All @@ -110,7 +110,7 @@
background-size: 4rem;

h3 {
font-size: var( --font-size-h1 );
font-size: var( --font-size-xxx-large );
}
}
}
Expand Down

0 comments on commit a9acc08

Please sign in to comment.