Skip to content

Commit f9c84a3

Browse files
committed
switch to noto and copy resources from node modules
1 parent 2b23830 commit f9c84a3

20 files changed

+786
-1254
lines changed

package-lock.json

Lines changed: 744 additions & 295 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@
99
"scripts": {
1010
"upgrade": "npx npm-check-updates -u -x 'codemirror'",
1111
"postinstall": "electron-builder install-app-deps",
12-
"tailwindcss-main:build": "npx @tailwindcss/cli -i ./src/renderer/main.css -o ./resources/public/css/main.css --minify",
13-
"tailwindcss-main:watch": "npx @tailwindcss/cli -i ./src/renderer/main.css -o ./resources/public/css/main.css --watch=always",
14-
"tailwindcss-frame:build": "npx @tailwindcss/cli -i ./src/renderer/frame/styles.css -o ./resources/public/css/frame.css --minify",
15-
"tailwindcss-frame:watch": "npx @tailwindcss/cli -i ./src/renderer/frame/styles.css -o ./resources/public/css/frame.css --watch=always",
12+
"tailwindcss:build": "npx @tailwindcss/cli -i ./src/renderer/main.css -o ./resources/public/css/main.css --minify",
13+
"tailwindcss:watch": "npx @tailwindcss/cli -i ./src/renderer/main.css -o ./resources/public/css/main.css --watch=always",
14+
"fonts:sans": "npx shx cp node_modules/@fontsource/noto-sans/files/**/*.* resources/public/css/files",
15+
"fonts:mono": "npx shx cp node_modules/@fontsource/noto-sans-mono/files/**/*.* resources/public/css/files",
16+
"fonts": "npx npm-run-all --parallel fonts:sans fonts:mono",
1617
"shadow:build": "npx shadow-cljs release main preload renderer bootstrap",
1718
"shadow:watch": "npx shadow-cljs watch main preload renderer bootstrap browser-test karma-test portfolio",
18-
"dev": "npx npm-run-all --parallel tailwindcss-main:watch tailwindcss-frame:watch shadow:watch",
19-
"build": "npx npm-run-all --parallel tailwindcss-main:build tailwindcss-frame:build shadow:build",
19+
"dev": "npx npm-run-all --parallel fonts tailwindcss:watch shadow:watch",
20+
"build": "npx npm-run-all --parallel fonts tailwindcs:build shadow:build",
2021
"portfolio": "npx shadow-cljs watch portfolio & npm run tailwindcss:watch",
2122
"electron": "npx electron .",
2223
"dist": "npx electron-builder",
@@ -65,6 +66,8 @@
6566
},
6667
"main": "resources/main.js",
6768
"devDependencies": {
69+
"@fontsource/noto-sans": "5.2.7",
70+
"@fontsource/noto-sans-mono": "5.2.7",
6871
"@mdn/browser-compat-data": "6.0.16",
6972
"@radix-ui/react-context-menu": "2.2.7",
7073
"@radix-ui/react-dialog": "1.1.7",
@@ -117,6 +120,7 @@
117120
"react-resizable-panels": "3.0.2",
118121
"react-svg": "16.3.0",
119122
"shadow-cljs": "3.1.5",
123+
"shx": "0.4.0",
120124
"snabbdom": "3.6.2",
121125
"source-map-support": "0.5.21",
122126
"stream-browserify": "3.0.0",

resources/public/fonts/LICENSE

Lines changed: 0 additions & 674 deletions
This file was deleted.
-1.33 MB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

resources/public/fonts/mono/LICENSE.md

Lines changed: 0 additions & 110 deletions
This file was deleted.
Binary file not shown.
Binary file not shown.

resources/public/fonts/sans/LICENSE.md

Lines changed: 0 additions & 110 deletions
This file was deleted.

src/renderer/components.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
outline: none;
55
padding: 4px 12px;
66
box-sizing: border-box;
7-
line-height: 18px;
87
font-size: 12px;
98
box-shadow: none !important;
109
color: var(--font-color) !important;

src/renderer/element/impl/container/svg.cljs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
{:on-pointer-up pointer-handler
3636
:on-pointer-down pointer-handler
3737
:on-pointer-move pointer-handler
38-
:fill "var(--font-color-muted)"
39-
:font-family "monospace"
38+
:fill "gray"
39+
:font-family "var(--font-mono)"
4040
:font-size (/ 12 zoom)}) (or (:label el) (name (:tag el)))]
4141

4242
[:rect

src/renderer/fonts.css

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/renderer/frame/styles.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/renderer/frame/views.cljs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,26 @@
3030

3131
:reagent-render #()})))
3232

33-
;; https://github.com/ryanseddon/react-frame-component#initialcontent
34-
(defonce initial-markup
35-
[:html {:data-theme "light"}
36-
[:head [:link {:rel "stylesheet" :href "./css/frame.css"}]]
37-
[:body {:style {:width "100%"
38-
:height "100%"
39-
:overflow "hidden"
40-
:user-select "none"
41-
:touch-action "none"
42-
:margin 0}}]])
33+
(defn initial-markup
34+
"https://github.com/ryanseddon/react-frame-component#initialcontent
35+
The iframe is isolated so we don't have access to the css vars of the parent."
36+
[]
37+
(let [body-styles (js/window.getComputedStyle js/document.body)]
38+
[:html {:style (into {}
39+
(map (fn [k] [k (.getPropertyValue body-styles k)]))
40+
["--font-sans"
41+
"--font-mono"
42+
"--color-accent"
43+
"--color-accent-light"
44+
"--color-accent-inverted"])}
45+
[:head]
46+
[:body {:style {:width "100%"
47+
:height "100%"
48+
:font-family "var(--font-sans)"
49+
:overflow "hidden"
50+
:user-select "none"
51+
:touch-action "none"
52+
:margin 0}}]]))
4353

4454
(def resize-observer
4555
(js/ResizeObserver.
@@ -77,7 +87,7 @@
7787
(js/KeyboardEvent. (.-type e)
7888
e)))]
7989
[:> Frame
80-
{:initial-content (server/render-to-static-markup initial-markup)
90+
{:initial-content (server/render-to-static-markup (initial-markup))
8191
:mount-target "body"
8292
:class "overflow-hidden flex-1 border-0"
8393
:on-key-down on-keyboard-event

src/renderer/main.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
@import 'codemirror/addon/hint/show-hint.css';
55
@import 'codemirror/theme/tomorrow-night-eighties.css';
66

7-
@import './fonts.css';
7+
@import "@fontsource/noto-sans";
8+
@import "@fontsource/noto-sans-mono";
9+
810
@import './utilities.css';
911
@import './components.css';
1012
@import './animations.css';

src/renderer/theme/styles.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@theme {
2-
--font-sans: 'Adwaita Sans', sans;
3-
--font-mono: 'Adwaita Mono', monospace;
2+
--font-sans: 'Noto Sans', sans;
3+
--font-mono: 'Noto Sans Mono', monospace;
44

55
--text-2xs: 10px;
66
--text-2xs--line-height: 14px;

src/renderer/tool/views.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
active (and (= (:id clicked-element) id)
4242
(= (:element clicked-element) element))]
4343
(into [:rect {:fill (if active "var(--color-accent)" "var(--color-accent-inverted)")
44-
:stroke (if active "var(--color-accent)" "var(--font-color-muted)")
44+
:stroke (if active "var(--color-accent)" "gray")
4545
:stroke-width stroke-width
4646
:x (- x (/ size 2))
4747
:y (- y (/ size 2))

0 commit comments

Comments
 (0)