Skip to content

Commit 5e5f48e

Browse files
committed
refine palette styles
1 parent 4f28e7a commit 5e5f48e

File tree

4 files changed

+38
-17
lines changed

4 files changed

+38
-17
lines changed

entry/main.css

+14
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,17 @@ body * {
1616
.is-unremarkable:hover {
1717
opacity: 1;
1818
}
19+
20+
::-webkit-scrollbar {
21+
width: 1px;
22+
height: 1px;
23+
}
24+
25+
::-webkit-scrollbar-track {
26+
background-color: hsla(0,0%,100%,0);
27+
}
28+
29+
::-webkit-scrollbar-thumb {
30+
background-color: hsla(0,0%,100%,0.3);
31+
}
32+

src/app/comp/command.cljs

+10-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,23 @@
22
(ns app.comp.command
33
(:require [clojure.string :as string]
44
[respo.core :refer [defcomp div <> span input]]
5-
[hsl.core :refer [hsl]]))
6-
7-
(defn on-click [on-select] (fn [e dispatch!] (on-select dispatch!)))
5+
[hsl.core :refer [hsl]]
6+
[respo.comp.space :refer [=<]]
7+
[respo-ui.core :as ui]))
88

99
(def style-command
1010
{:backgroud-color (hsl 0 0 0),
1111
:padding "0 8px",
12-
:line-height 2.4,
13-
:font-family "Source Code Pro, Menlo,monospace",
12+
:line-height "30px",
13+
:font-family ui/font-normal,
1414
:cursor "pointer"})
1515

1616
(defcomp
1717
comp-command
1818
(command selected? on-select)
1919
(div
20-
{:style (merge style-command (if selected? {:background-color (hsl 0 0 30)})),
21-
:on-click (on-click on-select)}
22-
(<> span (string/join " " command) nil)))
20+
{:style (merge style-command (if selected? {:background-color (hsl 0 0 20 0.8)})),
21+
:on-click (fn [e dispatch!] (on-select dispatch!))}
22+
(case (first command)
23+
:defs (div {} (<> (get command 2)) (=< 16 nil) (<> (get command 1) {:color (hsl 0 0 40)}))
24+
(<> (string/join " " command) nil))))

src/app/util/detect.cljs

+4-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525

2626
(defn fuzzy-search [pieces queries]
2727
(every?
28-
(fn [query] (some (fn [piece] (string/includes? (str piece) query)) pieces))
28+
(fn [query]
29+
(some
30+
(fn [piece] (string/includes? (str piece) query))
31+
(if (= :defs (first pieces)) (subvec pieces 1) pieces)))
2932
queries))
3033

3134
(defn strip-atom [token]

stack.cirru

+10-8
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,21 @@
8686
:procs $ []
8787
|comp.command $ {}
8888
:ns $ [] |ns |app.comp.command
89-
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |hsl.core |:refer $ [] |[] |hsl)
89+
[] |:require ([] |[] |clojure.string |:as |string) ([] |[] |respo.core |:refer $ [] |[] |defcomp |div |<> |span |input) ([] |[] |hsl.core |:refer $ [] |[] |hsl) ([] |[] |respo.comp.space |:refer $ [] |[] |=<) ([] |[] |respo-ui.core |:as |ui)
9090
:defs $ {}
9191
|style-command $ [] |def |style-command
92-
[] |{} ([] |:backgroud-color $ [] |hsl |0 |0 |0) ([] |:padding "||0 8px") ([] |:line-height |2.4) ([] |:font-family "||Source Code Pro, Menlo,monospace") ([] |:cursor ||pointer)
93-
|on-click $ [] |defn |on-click ([] |on-select)
94-
[] |fn ([] |e |dispatch!) ([] |on-select |dispatch!)
92+
[] |{} ([] |:backgroud-color $ [] |hsl |0 |0 |0) ([] |:padding "||0 8px") ([] |:line-height "|\"30px") ([] |:font-family |ui/font-normal) ([] |:cursor ||pointer)
9593
|comp-command $ [] |defcomp |comp-command ([] |command |selected? |on-select)
9694
[] |div
9795
[] |{}
9896
[] |:style $ [] |merge |style-command
99-
[] |if |selected? $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |30)
100-
[] |:on-click $ [] |on-click |on-select
101-
[] |<> |span ([] |string/join "|| " |command) (, |nil)
97+
[] |if |selected? $ [] |{} ([] |:background-color $ [] |hsl |0 |0 |20 |0.8)
98+
[] |:on-click $ [] |fn ([] |e |dispatch!) ([] |on-select |dispatch!)
99+
[] |case ([] |first |command)
100+
[] |:defs $ [] |div ([] |{}) ([] |<> $ [] |get |command |2) ([] |=< |16 |nil)
101+
[] |<> ([] |get |command |1)
102+
[] |{} $ [] |:color ([] |hsl |0 |0 |40)
103+
[] |<> ([] |string/join "|| " |command) (, |nil)
102104
:procs $ []
103105
|updater $ {}
104106
:ns $ [] |ns |app.updater
@@ -1111,7 +1113,7 @@
11111113
[] |some
11121114
[] |fn ([] |piece)
11131115
[] |string/includes? ([] |str |piece) (, |query)
1114-
, |pieces
1116+
[] |if ([] |= |:defs $ [] |first |pieces) ([] |subvec |pieces |1) (, |pieces)
11151117
, |queries
11161118
|contains-def? $ [] |defn |contains-def? ([] |files |ns-part |name-part) ([] |println "||Contains def:" |ns-part |name-part)
11171119
[] |if ([] |contains? |files |ns-part)

0 commit comments

Comments
 (0)