From c44b723d8c172e739f36c2ea47abb1185b89f37a Mon Sep 17 00:00:00 2001 From: Richard LT Date: Wed, 6 Oct 2021 15:53:14 +0200 Subject: [PATCH] feat(ui): use local fonts (#5966) --- .gitignore | 9 ++++++++- ui/Makefile | 2 +- ui/angular.json | 12 ++++++------ ui/karma.conf.js | 2 +- ui/package.json | 3 +++ ui/semantic/src/site/globals/site.variables | 5 +++++ ui/src/styles.scss | 14 ++++++++++++-- 7 files changed, 36 insertions(+), 11 deletions(-) create mode 100644 ui/semantic/src/site/globals/site.variables diff --git a/.gitignore b/.gitignore index 522f499e56..e1f9a112e8 100644 --- a/.gitignore +++ b/.gitignore @@ -44,8 +44,15 @@ ui/coverage ui/tests ui/typings ui/src/app/**/*.js -ui/semantic ui/semantic\\ +ui/semantic/* +!ui/semantic/src +ui/semantic/src/* +!ui/semantic/src/site +ui/semantic/src/site/* +!ui/semantic/src/site/globals +ui/semantic/src/site/globals/* +!ui/semantic/src/site/globals/site.variables ui/e2e/*.png ui/documentation ui/dist diff --git a/ui/Makefile b/ui/Makefile index 1aea4412c7..4222ddfacc 100644 --- a/ui/Makefile +++ b/ui/Makefile @@ -5,7 +5,7 @@ VERSION := $(if ${CDS_VERSION},${CDS_VERSION},snapshot) clean: @rm -rf dist @rm -rf node_modules - @rm -rf semantic + @find semantic -name "*" -not -path "*/site/globals/site.variables" -delete @rm -rf semantic\\ @rm -f package-lock.json diff --git a/ui/angular.json b/ui/angular.json index a20dcb7736..b4c636cff6 100644 --- a/ui/angular.json +++ b/ui/angular.json @@ -29,16 +29,15 @@ "node_modules/codemirror/addon/hint/show-hint.css", "node_modules/codemirror/addon/lint/lint.css", "node_modules/codemirror/theme/darcula.css", - "node_modules/fomantic-ui/dist/semantic.css", "node_modules/angular2-toaster-sgu/toaster.css", "node_modules/font-awesome/css/font-awesome.css", "node_modules/animate.css/animate.min.css", "node_modules/prismjs/themes/prism-okaidia.css", + "semantic/dist/semantic.min.css", "src/styles.scss" ], "scripts": [ "node_modules/jquery/dist/jquery.js", - "node_modules/fomantic-ui/dist/semantic.min.js", "node_modules/codemirror/lib/codemirror.js", "node_modules/codemirror/mode/shell/shell.js", "node_modules/codemirror/addon/mode/simple.js", @@ -62,7 +61,8 @@ "node_modules/js-yaml/dist/js-yaml.js", "resources/cds-hint.js", "node_modules/ansi_up/ansi_up.js", - "node_modules/prismjs/prism.js" + "node_modules/prismjs/prism.js", + "semantic/dist/semantic.min.js" ], "allowedCommonJsDependencies": [ "raven-js", @@ -137,7 +137,6 @@ "tsConfig": "src/tsconfig.spec.json", "scripts": [ "node_modules/jquery/dist/jquery.js", - "node_modules/fomantic-ui/dist/semantic.min.js", "node_modules/codemirror/lib/codemirror.js", "node_modules/codemirror/mode/shell/shell.js", "node_modules/codemirror/addon/mode/simple.js", @@ -155,16 +154,17 @@ "node_modules/codemirror/addon/edit/matchbrackets.js", "node_modules/codemirror/addon/display/autorefresh.js", "resources/cds-hint.js", - "node_modules/ansi_up/ansi_up.js" + "node_modules/ansi_up/ansi_up.js", + "semantic/dist/semantic.min.js" ], "styles": [ "node_modules/dragula/dist/dragula.css", "node_modules/codemirror/lib/codemirror.css", "node_modules/codemirror/addon/hint/show-hint.css", - "node_modules/fomantic-ui/dist/semantic.css", "node_modules/angular2-toaster-sgu/toaster.css", "node_modules/font-awesome/css/font-awesome.css", "node_modules/animate.css/animate.min.css", + "semantic/dist/semantic.min.css", "src/styles.scss" ], "assets": [ diff --git a/ui/karma.conf.js b/ui/karma.conf.js index 9401ebe76e..8bcd2550ef 100644 --- a/ui/karma.conf.js +++ b/ui/karma.conf.js @@ -17,7 +17,7 @@ module.exports = function (config) { {pattern: './src/test.ts', watched: false}, {pattern: './src/assets/**/*.png', watched: false, included: false, served: true}, {pattern: './node_modules/jquery/dist/jquery.js', watch: false, included: true, served: true}, - {pattern: './node_modules/fomantic-ui/dist/semantic.js', watch: false, included: true, served: true}, + {pattern: './semantic/dist/semantic.js', watch: false, included: true, served: true}, {pattern: './node_modules/codemirror/lib/codemirror.js', watch: false, included: true, served: true}, {pattern: './node_modules/dragula/dist/dragula.js', watch: false, included: true, served: true} ], diff --git a/ui/package.json b/ui/package.json index 35663a7626..722fd2792b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -9,6 +9,8 @@ }, "scripts": { "ng": "ng", + "gulp": "gulp", + "build:semantic": "gulp -f ./semantic/gulpfile.js build", "start": "ng serve -c development", "test": "ng test --watch false --code-coverage", "e2e": "testcafe chromium:headless ./e2e/tests/* -S -s screenshots", @@ -40,6 +42,7 @@ "@angular/platform-browser": "11.2.14", "@angular/platform-browser-dynamic": "11.2.14", "@angular/router": "11.2.14", + "@fontsource/lato": "4.5.0", "@icholy/duration": "5.0.0", "@ngui/auto-complete": "3.0.0", "@ngx-translate/core": "12.1.2", diff --git a/ui/semantic/src/site/globals/site.variables b/ui/semantic/src/site/globals/site.variables new file mode 100644 index 0000000000..fabda34e0d --- /dev/null +++ b/ui/semantic/src/site/globals/site.variables @@ -0,0 +1,5 @@ +/******************************* + User Global Variables +*******************************/ + +@importGoogleFonts : false; diff --git a/ui/src/styles.scss b/ui/src/styles.scss index d1d2d6016c..1c5022b1bb 100644 --- a/ui/src/styles.scss +++ b/ui/src/styles.scss @@ -2,6 +2,16 @@ @import "common"; +@import "~@fontsource/lato/scss/mixins"; + +@include fontFace($style: italic, $weight: 400); + +@include fontFace($style: italic, $weight: 700); + +@include fontFace($style: normal, $weight: 400); + +@include fontFace($style: normal, $weight: 700); + html, body { overflow-y: hidden; @@ -50,11 +60,11 @@ a.disabled:hover { } .CodeMirror-empty { - color: $polar_grey_2 !important; + color: $polar_grey_2 !important; } app-workflow-admin .CodeMirror-scroll { - min-height: 180px; + min-height: 180px; } .fullheight {