Skip to content

Commit

Permalink
[#1905] Set Roboto as standard font statically
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Jan 15, 2024
1 parent 2010c2d commit f3b9491
Show file tree
Hide file tree
Showing 42 changed files with 1,166 additions and 29 deletions.
4 changes: 2 additions & 2 deletions src/open_inwoner/js/components/accessibility/change_font.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class ChangeFont {
let root = document.documentElement
const varName = '--font-family-body'

if (root.style.getPropertyValue(varName) == 'Open Dyslexic') {
root.style.setProperty(varName, 'TheSans C5')
if (root.style.getPropertyValue(varName) === 'Open Dyslexic') {
root.style.setProperty(varName, 'Roboto')
this.text.innerText = this.node.dataset.text
} else {
root.style.setProperty(varName, 'Open Dyslexic')
Expand Down
128 changes: 101 additions & 27 deletions src/open_inwoner/scss/views/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
/// Font.

--font-color-heading: var(--color-black);
--font-family-heading: 'TheMix C5';
--font-family-heading: 'Roboto Medium';
--font-weight-heading: bold;

--font-color-heading-1: var(--font-color-heading);
Expand Down Expand Up @@ -221,7 +221,7 @@

--font-size-heading-card: 18px;

--font-family-body: 'TheSans C5';
--font-family-body: 'Roboto';
--font-color-body: var(--color-gray-dark);
--font-size-body: 16px;
--font-line-height-body: 21px;
Expand Down Expand Up @@ -254,63 +254,137 @@
}

@font-face {
font-family: 'TheMix C5';
font-family: 'Roboto';
font-weight: normal;
src: local('TheMix C5'),
url('/static/fonts/TheMixC5/DesktopFonts/TheMixC5-5_Plain.otf')
format('opentype');
url('/static/fonts/Roboto/Roboto-Regular-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Regular-webfont.eot')
format('embedded-opentype'),
url('/static/fonts/Roboto/Roboto-Regular-webfont.ttf') format('truetype'),
url('/static/fonts/Roboto/Roboto-Regular-webfont.svg') format('svg');
}

@font-face {
font-family: 'TheMix C5';
font-family: 'Roboto';
font-weight: 100;
src: url('/static/fonts/Roboto/Roboto-Thin-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Thin.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: 300;
src: url('/static/fonts/Roboto/Roboto-Light-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Light.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: 400;
src: url('/static/fonts/Roboto/Roboto-Regular-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Regular-webfont.eot')
format('embedded-opentype'),
url('/static/fonts/Roboto/Roboto-Regular-webfont.ttf') format('truetype'),
url('/static/fonts/Roboto/Roboto-Regular-webfont.svg') format('svg');
}

@font-face {
font-family: 'Roboto';
font-weight: 500;
src: url('/static/fonts/Roboto/Roboto-Medium-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Medium.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto Medium';
font-weight: bold;
src: local('TheMix C5'),
url('/static/fonts/TheMixC5/DesktopFonts/TheMixC5-7_Bold.otf')
format('opentype');
font-style: normal;
src: url('/static/fonts/Roboto/Roboto-Medium-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Medium.ttf') format('truetype');
}

@font-face {
font-family: 'TheSans C5';
src: local('TheSans C5'),
url('/static/fonts/TheSansC5/DesktopFonts/TheSansC5-5_Plain.otf')
format('opentype');
font-family: 'Roboto Medium';
font-weight: bold;
font-style: italic;
src: url('/static/fonts/Roboto/Roboto-MediumItalic-webfont.woff')
format('woff'),
url('/static/fonts/Roboto/Roboto-MediumItalic.ttf') format('truetype');
}

@font-face {
font-family: 'TheSans C5';
font-family: 'Roboto';
font-weight: bold;
src: local('TheSans C5'),
url('/static/fonts/TheSansC5/DesktopFonts/TheSansC5-7_Bold.otf')
format('opentype');
font-style: normal;
src: url('/static/fonts/Roboto/Roboto-Medium-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Medium.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: bold;
font-style: italic;
src: url('/static/fonts/Roboto/Roboto-MediumItalic-webfont.woff')
format('woff'),
url('/static/fonts/Roboto/Roboto-MediumItalic.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: 800;
src: url('/static/fonts/Roboto/Roboto-Bold-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Bold.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: 900;
src: url('/static/fonts/Roboto/Roboto-Black-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Black.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: normal;
font-style: italic;
src: url('/static/fonts/Roboto/Roboto-Italic-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-Italic.ttf') format('truetype');
}

@font-face {
font-family: 'Roboto';
font-weight: bold;
font-style: italic;
src: url('/static/fonts/Roboto/Roboto-BoldItalic-webfont.woff') format('woff'),
url('/static/fonts/Roboto/Roboto-BoldItalic.ttf') format('truetype');
}

@font-face {
font-family: 'Open Dyslexic';
src: local('TheSans C5'),
url('/static/fonts/opendyslexic/OpenDyslexic-Regular.otf')
format('opentype');
src: url('/static/fonts/opendyslexic/OpenDyslexic-Regular.otf')
format('opentype');
}

@font-face {
font-family: 'Open Dyslexic';
font-weight: bold;
src: local('TheSans C5'),
url('/static/fonts/opendyslexic/OpenDyslexic-Bold.otf') format('opentype');
src: url('/static/fonts/opendyslexic/OpenDyslexic-Bold.otf')
format('opentype');
}

@font-face {
font-family: 'Open Dyslexic';
font-style: italic;
src: local('TheSans C5'),
url('/static/fonts/opendyslexic/OpenDyslexic-Italic.otf') format('opentype');
src: url('/static/fonts/opendyslexic/OpenDyslexic-Italic.otf')
format('opentype');
}

@font-face {
font-family: 'Open Dyslexic';
font-weight: bold;
font-style: italic;
src: local('TheSans C5'),
url('/static/fonts/opendyslexic/OpenDyslexic-Bold-Italic.otf')
format('opentype');
src: url('/static/fonts/opendyslexic/OpenDyslexic-Bold-Italic.otf')
format('opentype');
}

html {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit f3b9491

Please sign in to comment.