Convert styles.css to SASS and include it by importing it in main.js.

Add fonts: Hack and Open Sans.
Change editor font to Hack.
This commit is contained in:
Jonatan Heyman 2023-01-15 19:55:26 +01:00
parent 7aab3874b0
commit 3b905951af
51 changed files with 172 additions and 33 deletions

View File

@ -6,7 +6,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
<title>heynote</title> <title>heynote</title>
<link rel="stylesheet" href="src/editor/styles.css" />
</head> </head>
<body> <body>

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.

View File

@ -0,0 +1,12 @@
@import "sass/variables";
@import "sass/mixins";
@import "sass/Light";
@import "sass/LightItalic";
@import "sass/Regular";
@import "sass/Italic";
@import "sass/Semibold";
@import "sass/SemiboldItalic";
@import "sass/Bold";
@import "sass/BoldItalic";
@import "sass/ExtraBold";
@import "sass/ExtraBoldItalic";

4
public/font/open-sans/sass/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
# Ignore everything in this directory
# *
# Except this file
!.gitignore

View File

@ -0,0 +1,8 @@
/* BEGIN Bold */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "Bold");
font-weight: bold;
font-style: normal;
}
/* END Bold */

View File

@ -0,0 +1,8 @@
/* BEGIN Bold Italic */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "BoldItalic");
font-weight: bold;
font-style: italic;
}
/* END Bold Italic */

View File

@ -0,0 +1,8 @@
/* BEGIN Extrabold */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "ExtraBold");
font-weight: 800;
font-style: normal;
}
/* END Extrabold */

View File

@ -0,0 +1,8 @@
/* BEGIN Extrabold Italic */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "ExtraBoldItalic");
font-weight: 800;
font-style: italic;
}
/* END Extrabold Italic */

View File

@ -0,0 +1,8 @@
/* BEGIN Italic */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "Italic");
font-weight: normal;
font-style: italic;
}
/* END Italic */

View File

@ -0,0 +1,8 @@
/* BEGIN Light */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "Light");
font-weight: 300;
font-style: normal;
}
/* END Light */

View File

@ -0,0 +1,8 @@
/* BEGIN Light Italic */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "LightItalic");
font-weight: 300;
font-style: italic;
}
/* END Light Italic */

View File

@ -0,0 +1,8 @@
/* BEGIN Regular */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "Regular");
font-weight: normal;
font-style: normal;
}
/* END Regular */

View File

@ -0,0 +1,8 @@
/* BEGIN Semibold */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "Semibold");
font-weight: 600;
font-style: normal;
}
/* END Semibold */

View File

@ -0,0 +1,8 @@
/* BEGIN Semibold Italic */
@font-face {
font-family: 'Open Sans';
@include fontdef($OpenSansPath, $OpenSansVersion, "SemiboldItalic");
font-weight: 600;
font-style: italic;
}
/* END Semibold Italic */

View File

@ -0,0 +1,4 @@
@mixin fontdef($OpenSansPath, $OpenSansVersion, $FontType:"Regular") {
src: url('#{$OpenSansPath}/#{$FontType}/OpenSans-#{$FontType}.woff2?v=#{$OpenSansVersion}') format('woff2'),
url('#{$OpenSansPath}/#{$FontType}/OpenSans-#{$FontType}.woff?v=#{$OpenSansVersion}') format('woff');
}

View File

@ -0,0 +1,2 @@
$OpenSansPath: "/font/open-sans/fonts" !default;
$OpenSansVersion: "1.1.0" !default;

View File

@ -0,0 +1,12 @@
@import "variables";
@import "mixins";
@import "Light";
@import "LightItalic";
@import "Regular";
@import "Italic";
@import "Semibold";
@import "SemiboldItalic";
@import "Bold";
@import "BoldItalic";
@import "ExtraBold";
@import "ExtraBoldItalic";

View File

@ -116,10 +116,10 @@
+dark-mode +dark-mode
opacity: 0.9 opacity: 0.9
&.dark &.dark
background-image: url("/icons/dark-mode.png") background-image: url("icons/dark-mode.png")
&.light &.light
background-image: url("/icons/light-mode.png") background-image: url("icons/light-mode.png")
&.system &.system
background-image: url("/icons/both-mode.png") background-image: url("icons/both-mode.png")
</style> </style>

2
src/css/application.sass Normal file
View File

@ -0,0 +1,2 @@
@import "font"
@import "base"

23
src/css/base.sass Normal file
View File

@ -0,0 +1,23 @@
html, body
margin: 0
padding: 0
background: #fff
color: #444
font-family: 'Gill Sans','Gill Sans MT',Calibri,'Trebuchet MS',sans-serif
height: 100%
font-size: 12px
overscroll-behavior-y: none
#app
height: 100%
width: 100%
.editor
height: 100%
.cm-editor
height: 100%
#syntaxTree
height: 20%
overflow-y: auto

27
src/css/font.sass Normal file
View File

@ -0,0 +1,27 @@
@font-face
font-family: 'Hack'
src: url('/font/hack/hack-regular.woff2') format('woff2'), url('/font/hack/hack-regular.woff') format('woff')
font-weight: 400
font-style: normal
@font-face
font-family: 'Hack'
src: url('/font/hack/hack-bold.woff2') format('woff2'), url('/font/hack/hack-bold.woff') format('woff')
font-weight: 700
font-style: normal
@font-face
font-family: 'Hack'
src: url('/font/hack/hack-italic.woff2') format('woff2'), url('/font/hack/hack-italic.woff') format('woff')
font-weight: 400
font-style: italic
@font-face
font-family: 'Hack'
src: url('/font/hack/hack-bolditalic.woff2') format('woff2'), url('/font/hack/hack-bolditalic.woff') format('woff')
font-weight: 700
font-style: italic
@import "~/../public/font/open-sans/open-sans"

View File

@ -1,28 +0,0 @@
html,
body {
margin: 0;
padding: 0;
background: #fff;
color: #444;
font-family: 'Gill Sans','Gill Sans MT',Calibri,'Trebuchet MS',sans-serif;
height: 100%;
font-size: 12px;
overscroll-behavior-y: none;
}
#app {
height: 100%;
width: 100%;
}
.editor {
height: 100%;
}
.editor .cm-editor {
height: 100%;
}
#syntaxTree {
height: 20%;
overflow-y: auto;
}

View File

@ -9,7 +9,7 @@ export const heynoteBase = EditorView.theme({
paddingTop: 4, paddingTop: 4,
}, },
'.cm-scroller': { '.cm-scroller': {
fontFamily: "Menlo, Monaco, 'Courier New', monospace", fontFamily: "Hack, Menlo, Monaco, 'Courier New', monospace",
}, },
'.cm-gutters': { '.cm-gutters': {
padding: '0 2px 0 4px', padding: '0 2px 0 4px',

View File

@ -1,3 +1,5 @@
import './css/application.sass'
import { createApp } from 'vue' import { createApp } from 'vue'
import App from './App.vue' import App from './App.vue'