Skip to content

Commit

Permalink
feat: remove google font and use local font included with webui
Browse files Browse the repository at this point in the history
  • Loading branch information
zelfroster committed Jan 14, 2024
1 parent ca26e85 commit 7bd9812
Show file tree
Hide file tree
Showing 38 changed files with 154 additions and 14 deletions.
17 changes: 16 additions & 1 deletion webui-src/app/scss/abstracts/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
@mixin blockquote($type) {
position: relative;
line-height: 1.2;

@if ($type == 'info') {
color: transparentize($dark-color, 0.2);
border: 1px solid transparentize($primary-retro-color, 0.2);
Expand All @@ -45,11 +46,13 @@
} @else if ($type == 'danger') {
border: 1px solid transparentize($red-color, 0.2);
}

&::before {
font-family: 'Font Awesome 5 Free';
position: absolute;
top: 0.5rem;
left: 0.5rem;

@if ($type == 'info') {
content: '\f05a';
color: $primary-color;
Expand All @@ -65,16 +68,28 @@

@mixin flex($direction: '', $justify: '', $align: '', $gap: 0) {
display: flex;

@if ($direction != '') {
flex-direction: $direction;
}

@if ($justify != '') {
justify-content: $justify;
}

@if ($align != '') {
align-items: $align;
}
@if ($gap != 0) {

@if ($gap !=0) {
gap: $gap;
}
}

// Font
@mixin fontdef-woff($FontPath, $FontName, $FontVersion: '1.0.0', $FontType: 'Regular') {
src:
url('#{$FontPath}/#{$FontName}-#{$FontType}.woff2') format('woff2'),
url('#{$FontPath}/#{$FontName}-#{$FontType}.woff') format('woff'),
url('#{$FontPath}/#{$FontName}-#{$FontType}.ttf') format('truetype');
}
3 changes: 3 additions & 0 deletions webui-src/app/scss/abstracts/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// -----------------------------------------------------------------------------
// This file contains all application-wide Sass variables.
// -----------------------------------------------------------------------------
$FontPath: './webfonts' !default;
$FontName: 'Roboto' !default;
$FontVersion: '3.008' !default;
2 changes: 2 additions & 0 deletions webui-src/app/scss/base/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ body {
text-rendering: optimizeSpeed;
line-height: 1.5;
font-family: 'Roboto', Arial, Helvetica, sans-serif !important;
letter-spacing: -0.025ch;
}

/* A elements that don't have a class get default styles */
Expand Down Expand Up @@ -70,6 +71,7 @@ select {
html:focus-within {
scroll-behavior: auto;
}

*,
*::before,
*::after {
Expand Down
18 changes: 18 additions & 0 deletions webui-src/app/scss/fontface/_Bold.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@use '../abstracts' as *;

/* BEGIN Bold */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Bold');
font-weight: 700;
font-style: normal;
}

@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Bold');
font-weight: bold;
font-style: normal;
}

/* END Bold */
18 changes: 18 additions & 0 deletions webui-src/app/scss/fontface/_BoldItalic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@use '../abstracts' as *;

/* BEGIN Bold Italic */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'BoldItalic');
font-weight: 700;
font-style: italic;
}

@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'BoldItalic');
font-weight: bold;
font-style: italic;
}

/* END Bold Italic */
18 changes: 18 additions & 0 deletions webui-src/app/scss/fontface/_Italic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@use '../abstracts' as *;

/* BEGIN Italic */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Italic');
font-weight: 400;
font-style: italic;
}

@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Italic');
font-weight: normal;
font-style: italic;
}

/* END Italic */
11 changes: 11 additions & 0 deletions webui-src/app/scss/fontface/_Light.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use '../abstracts' as *;

/* BEGIN Light */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Light');
font-weight: 300;
font-style: normal;
}

/* END Light */
11 changes: 11 additions & 0 deletions webui-src/app/scss/fontface/_LightItalic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use '../abstracts' as *;

/* BEGIN Light Italic */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'LightItalic');
font-weight: 300;
font-style: italic;
}

/* END Light Italic */
11 changes: 11 additions & 0 deletions webui-src/app/scss/fontface/_Medium.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use '../abstracts' as *;

/* BEGIN Medium */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Medium');
font-weight: 500;
font-style: normal;
}

/* END Medium */
11 changes: 11 additions & 0 deletions webui-src/app/scss/fontface/_MediumItalic.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@use '../abstracts' as *;

/* BEGIN Medium Italic */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'MediumItalic');
font-weight: 500;
font-style: italic;
}

/* END Medium Italic */
18 changes: 18 additions & 0 deletions webui-src/app/scss/fontface/_Regular.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@use '../abstracts' as *;

/* BEGIN Regular */
@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Regular');
font-weight: 400;
font-style: normal;
}

@font-face {
font-family: Roboto;
@include fontdef-woff($FontPath, $FontName, $FontVersion, 'Regular');
font-weight: normal;
font-style: normal;
}

/* END Regular */
8 changes: 8 additions & 0 deletions webui-src/app/scss/fontface/_index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@forward 'Bold';
@forward 'BoldItalic';
@forward 'Medium';
@forward 'MediumItalic';
@forward 'Regular';
@forward 'Italic';
@forward 'Light';
@forward 'LightItalic';
16 changes: 9 additions & 7 deletions webui-src/app/scss/main.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
@charset "UTF-8";

// 1. Configuration and helpers
@use "abstracts";
@use 'abstracts';

// 2. Font faces
@use 'fontface';

// 2. Vendors specific files
@use "vendors";
@use 'vendors';

// 3. Base stuff
@use "base";
@use 'base';

// 4. Components
@use "components";
@use 'components';

// 5. Layout-related sections
@use "layouts";
@use 'layouts';

// 6. Page-specific styles
@use "pages";

@use 'pages';
Binary file added webui-src/assets/webfonts/Roboto-Bold.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Bold.woff
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Bold.woff2
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-BoldItalic.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-BoldItalic.woff
Binary file not shown.
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Italic.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Italic.woff
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Italic.woff2
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Light.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Light.woff
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Light.woff2
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-LightItalic.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-LightItalic.woff
Binary file not shown.
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Medium.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Medium.woff
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Medium.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Regular.ttf
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Regular.woff
Binary file not shown.
Binary file added webui-src/assets/webfonts/Roboto-Regular.woff2
Binary file not shown.
6 changes: 0 additions & 6 deletions webui-src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="styles.css" />
<link href="images/retroshare.svg" rel="icon" data-n-head="true" type="image/svg" />
<title>RetroShare</title>
Expand Down

0 comments on commit 7bd9812

Please sign in to comment.