Skip to content

Commit 3c6e2dc

Browse files
author
abtv
committed
lein-sass support
1 parent 3d1b6a6 commit 3c6e2dc

File tree

5 files changed

+44
-38
lines changed

5 files changed

+44
-38
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
twitter-security.edn
22
resources/public/js/
33
resources/public/main.js
4+
resources/public/css/site.css
5+
resources/public/css/site.css.map
46
target/
57
backend-release/
68
frontend-release/main.js

resources/public/css/sb-admin.css renamed to design/site.scss

+17-29
Original file line numberDiff line numberDiff line change
@@ -27,29 +27,27 @@
2727

2828
#wrapper {
2929
padding-left: 0;
30+
31+
@media(min-width:768px){
32+
padding-left: 171px;
33+
}
3034
}
3135

3236
#page-wrapper {
3337
width: 100%;
3438
padding: 0;
3539
background-color: #fff;
40+
41+
@media(min-width:768px){
42+
padding: 10px;
43+
}
3644
}
3745

3846
.huge {
3947
font-size: 50px;
4048
line-height: normal;
4149
}
4250

43-
@media(min-width:768px) {
44-
#wrapper {
45-
padding-left: 171px;
46-
}
47-
48-
#page-wrapper {
49-
padding: 10px;
50-
}
51-
}
52-
5351
/* Top Navigation */
5452

5553
.top-nav {
@@ -303,28 +301,24 @@ ul.alert-dropdown {
303301

304302
.desktop-time {
305303
display: block;
304+
305+
@media(max-width: 768px){
306+
display: none;
307+
}
306308
}
307309

308310
.mobile-time {
309311
display: none;
310-
}
311312

312-
@media(max-width: 768px) {
313-
.desktop-time {
314-
display: none;
315-
}
316-
317-
.mobile-time {
313+
@media(max-width: 768px){
318314
display: block;
319315
}
320316
}
321317

322318
.fork-me-desktop {
323319
display: block;
324-
}
325320

326-
@media(max-width: 768px){
327-
.fork-me-desktop {
321+
@media(max-width: 768px){
328322
display: none;
329323
}
330324
}
@@ -339,10 +333,8 @@ ul.alert-dropdown {
339333
display: none;
340334
height: 50px;
341335
margin: 0;
342-
}
343336

344-
@media(max-width: 768px){
345-
.fork-me-mobile-wrapper{
337+
@media(max-width: 768px){
346338
display: inline;
347339
}
348340
}
@@ -374,20 +366,16 @@ ul.alert-dropdown {
374366

375367
.trends-controls-desktop {
376368
display: block;
377-
}
378369

379-
@media(max-width: 768px){
380-
.trends-controls-desktop {
370+
@media(max-width: 768px){
381371
display: none;
382372
}
383373
}
384374

385375
.trends-controls-mobile {
386376
display: none;
387-
}
388377

389-
@media(max-width: 768px){
390-
.trends-controls-mobile {
378+
@media(max-width: 768px){
391379
display: block;
392380
}
393381
}

project.clj

+14-3
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,24 @@
4646
:plugins [[lein-environ "1.0.2"]
4747
[ragtime/ragtime.lein "0.3.9"]
4848
[lein-cljsbuild "1.1.3"]
49-
[lein-figwheel "0.5.0-6"]]
49+
[lein-figwheel "0.5.0-6"]
50+
[lein-sass "0.3.7"]]
51+
52+
:figwheel {:css-dirs ["resources/public/css"]}
53+
54+
:sass {:src "design/"
55+
:output-directory "resources/public/css/"
56+
:delete-output-dir false
57+
:source-maps true}
58+
59+
:hooks [leiningen.sass]
5060

5161
:aliases {"migrate" ["run" "-m" "tech-radar.migrations/migrate"]
5262
"rollback" ["run" "-m" "tech-radar.migrations/rollback"]}
5363

54-
:cljsbuild {:builds {:dev {:source-paths ["src/cljs"]
55-
:figwheel {:websocket-host "localhost"}
64+
:cljsbuild {:builds {:dev {:figwheel {:load-warninged-code true
65+
:on-jsload "tech-radar.core/init-render"}
66+
:source-paths ["src/cljs"]
5667
:compiler {:main tech-radar.core
5768
:asset-path "js"
5869
:output-dir "resources/public/js"}}

resources/public/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<link href="css/bootstrap.min.css" rel="stylesheet">
1616
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
17-
<link href="css/sb-admin.css" rel="stylesheet">
17+
<link href="css/site.css" rel="stylesheet">
1818

1919
<!--[if lt IE 9]>
2020
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>

src/cljs/tech-radar/core.cljs

+10-5
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
(statistic-request app-state)
1414

1515
(def reconciler
16-
(om/reconciler {:state app-state
16+
(om/reconciler {:state app-state
1717
:normalize false
18-
:parser parser}))
18+
:parser parser}))
1919

20-
(om/add-root! reconciler
21-
RootComponent
22-
(.getElementById js/document "app"))
20+
(defn init-render []
21+
(when-let [element (.getElementById js/document "app")]
22+
(om/remove-root! reconciler element))
23+
(om/add-root! reconciler
24+
RootComponent
25+
(.getElementById js/document "app")))
26+
27+
(init-render)

0 commit comments

Comments
 (0)