From 43019b3313e85ad933315f011482110bf459ab73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Can=20Alt=C4=B1parmak?= Date: Sun, 7 Nov 2021 21:16:58 +0300 Subject: [PATCH] Add icon-font for better appeareance, resolve #4 Co-authored-by: Miguel Tavares --- package.json | 2 +- src/icomoon.woff | Bin 0 -> 1244 bytes src/main.js | 35 +++++++++++++++++++++++------------ 3 files changed, 24 insertions(+), 13 deletions(-) create mode 100644 src/icomoon.woff diff --git a/package.json b/package.json index 5325d14..9b03586 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "logseq-hypothesis", - "version": "0.1.4", + "version": "0.1.5", "main": "dist/index.html", "author": "c6p", "scripts": { diff --git a/src/icomoon.woff b/src/icomoon.woff new file mode 100644 index 0000000000000000000000000000000000000000..934de859bdc6d79abc55008d8d18e2d7b105b432 GIT binary patch literal 1244 zcmaKr%}*0S7{;I3ZHq024~0Vb&i zt8qj2joRF`^J9QG!dOaL>oM=yOu<;DmZN`NTGzt+2U(*mwHNeduC%sne(g53*W?e< zeCuDrIn!7Kw8!-0()xeCx|yR$?H&Eo(wZ*oZ*qmoDz)$QJER2wJ8xx}r^~gEDjUXn z!B}NoUFL+8`7v2E3MRD}Yu}f)IphDeY?UiKuiT%Lr;~IYVgp{*+0@?Bf8>nfE5?PN z{=p{N4tkOkzz+0ky^4fRqatW~Eu=tIA@wmPxsScf>VpRtI0krA8h-+z9n^R0b!ymW zQUBcKac8IiI|0G0R<(+wX~5)^D*d?27-cz_~XmB7h(H@JBpBf8x zws-i>2{G6{J`syg#)JKW5E&fsjZTQMxPzS?K`ot5Z})~HJ(?~1?OH9B8t(2sle!v> zMg_HSFD+r)dl|dbG`oh4Sls73IaJ-6nM!=BA<`pLdm{VyH~;PTja#i3f1uf;PPp~- z<#P$n=+w@*VZ>pLoOM|zUvk+) zzUQ(RL4;iPQJ;4?!1sKzl(7nyRm2i9uuz~`C@z?#@{&~yjgCaI023vYnZN+o8N~>q z4QDkJ=gsU&-YBuC$&Icc4+Eu!nMtcy31!WqSu!f-Vko^9n$B3W+}j9}s&<9dvs|XA dc4VN!agkaYYwV}h0cM>8aF2Z4LvQkr^9TFZv}gbT literal 0 HcmV?d00001 diff --git a/src/main.js b/src/main.js index 0a5d5ef..9bb1ea8 100644 --- a/src/main.js +++ b/src/main.js @@ -3,6 +3,7 @@ import Vue from 'vue' import vSelect from 'vue-select' import App from './App.vue' import "./index.css" +import Font from "./icomoon.woff" function main() { const pluginId = logseq.baseInfo.id; @@ -28,29 +29,39 @@ function main() { }); logseq.provideStyle(String.raw` - .icon-hypothesis { - background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg viewBox='0 0 384 448' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3EGroup%3C/title%3E%3Cg id='Page-1' stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg id='Group'%3E%3Cpath d='M240.941176,384 L352.003017,384 C369.64758,384 384,369.674463 384,352.003017 L384,31.9969832 C384,14.3524196 369.674463,0 352.003017,0 L31.9969832,0 C14.3524196,0 0,14.3255373 0,31.9969832 L0,352.003017 C0,369.64758 14.3255373,384 31.9969832,384 L143.058824,384 L192,448 L240.941176,384 L240.941176,384 Z' id='Rectangle-2-Copy-19' fill='%23BD1C2B'%3E%3C/path%3E%3Cpath d='M304,319.790403 C321.673112,319.790403 336,305.510435 336,287.895201 C336,270.279968 321.673112,256 304,256 C286.326888,256 272,270.279968 272,287.895201 C272,305.510435 286.326888,319.790403 304,319.790403 Z' id='Path' fill='%23FFFFFF'%3E%3C/path%3E%3Cpath d='M112.129807,64 L112.129807,176.030906 C112.129807,176.030907 128.173076,144.049455 160,144.04945 C192,144.049446 224.432693,160 224.43269,209.740579 L224.43269,320 L176.302883,320 L176.302883,224.055632 C176.302883,198 160,188 144,192 C128,196 112.129807,213 112.129807,248.04636 L112.129807,320 L64,320 L64,64' id='Path' fill='%23FFFFFF'%3E%3C/path%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); - background-repeat: no-repeat; - background-position: 50% 50%; - width: 1em; - height: 1em; - display: inline-block; - padding: 0.25rem; - margin: 0 0.25rem; + @font-face { + font-family: 'icomoon'; + src: url(${Font}) format('woff'); + font-weight: normal; + font-style: normal; + font-display: block; } - div[id^="hypothesis__/"] .block-properties:not(.page-properties) { display: none; + [class^="icon-"], [class*=" icon-"] { + font-family: 'icomoon' !important; + speak: never; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + } + .icon-hypothesis:before { + content: "\e900"; + } + div[id^="hypothesis__/"] .block-properties:not(.page-properties) { display: none; } `); logseq.App.registerUIItem('toolbar', { key: 'hypothesis', - template: ` + template: ` `, }); logseq.App.registerUIItem('pagebar', { key: 'hypothesis-page', - template: ` + template: ` `, });