Embed svg in cljs code

* move external svg image for dropdown into cljs code to avoid extra
  http requests
This commit is contained in:
Teemu Patja 2017-03-16 19:42:39 +02:00
parent 184f1ee6ee
commit 23de712604
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
4 changed files with 27 additions and 26 deletions

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: sketchtool 42 (36781) - http://www.bohemiancoding.com/sketch -->
<title>C09316C0-28C3-4D2D-AF57-806E1D6C1FE6</title>
<desc>Created with sketchtool.</desc>
<defs></defs>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="commiteth-desktop_repositories" transform="translate(-1098.000000, -32.000000)" fill="#FFFFFF">
<g id="header">
<g id="user" transform="translate(956.000000, 24.000000)">
<g id="icon_dropdown" transform="translate(142.000000, 8.000000)">
<path d="M7.76596419,11.5564843 C8.07705085,11.6115965 8.40862642,11.5177766 8.64937808,11.277025 L13.3038251,6.62257794 C13.6942764,6.23212667 13.695553,5.59768507 13.3050287,5.20716078 C12.9117818,4.81391382 12.2808006,4.81717535 11.8896116,5.20836438 L7.76949482,9.32848112 L3.64937808,5.20836438 C3.25892681,4.81791311 2.62448521,4.81663648 2.23396092,5.20716078 C1.84071396,5.60040773 1.84397549,6.23138892 2.23516452,6.62257794 L6.88961157,11.277025 C7.12783981,11.5152532 7.45689724,11.6086052 7.76596419,11.5564843 L7.76596419,11.5564843 Z" id="shape"></path>
</g>
</g>
</g>
</g>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -44,7 +44,7 @@
[:div.item [:div.item
(:login user)] (:login user)]
[:div.item [:div.item
[:span.dropdown.icon]] [svg/dropdown-icon]]
(into menu (into menu
(for [[target caption props] items] (for [[target caption props] items]
^{:key target} [:div.item ^{:key target} [:div.item

View File

@ -1,6 +1,5 @@
(ns commiteth.svg) (ns commiteth.svg)
(defn app-logo [] (defn app-logo []
[:svg [:svg
{:width "38px" {:width "38px"
@ -8,8 +7,7 @@
:viewBox "0 0 38 38" :viewBox "0 0 38 38"
:version "1.1"} :version "1.1"}
[:g [:g
{ {:id "page-1"
:id "page-1"
:transform "translate(-160.000000, -35.000000)" :transform "translate(-160.000000, -35.000000)"
:fillRule "nonzero" :fillRule "nonzero"
:fill "#B0F1EE"} :fill "#B0F1EE"}
@ -19,3 +17,28 @@
[:path [:path
{:d "M5.97918472,32.0208153 C-0.65972824,25.3819023 -0.65972824,12.6180977 5.97918472,5.97918472 C9.29958963,2.65877981 13.6518068,0.999051701 18.0037292,1.00000041 L33.9948134,1 C35.3783898,1 36.5,2.10966206 36.5,3.5 C36.5,4.88071187 35.3906622,6 33.9948134,6 L18.5,6 C15.264488,5.87626016 11.9850564,7.04438088 9.51471863,9.51471863 C4.82842712,14.2010101 4.82842712,23.7989899 9.51471863,28.4852814 C11.9850564,30.9556191 15.264488,32.1237398 18.5,31.9896435 L33.9948134,32 C35.3783898,32 36.5,33.1096621 36.5,34.5 C36.5,35.8807119 35.3906622,37 33.9948134,37 L18.0051866,37 C13.65181,37.0009495 9.29959083,35.3412214 5.97918472,32.0208153 Z M17.5,19 C17.5,17.6192881 18.6176026,16.5 20.0034561,16.5 L33.9965439,16.5 C35.3791645,16.5 36.5,17.6096621 36.5,19 C36.5,20.3807119 35.3823974,21.5 33.9965439,21.5 L20.0034561,21.5 C18.6208355,21.5 17.5,20.3903379 17.5,19 Z" {:d "M5.97918472,32.0208153 C-0.65972824,25.3819023 -0.65972824,12.6180977 5.97918472,5.97918472 C9.29958963,2.65877981 13.6518068,0.999051701 18.0037292,1.00000041 L33.9948134,1 C35.3783898,1 36.5,2.10966206 36.5,3.5 C36.5,4.88071187 35.3906622,6 33.9948134,6 L18.5,6 C15.264488,5.87626016 11.9850564,7.04438088 9.51471863,9.51471863 C4.82842712,14.2010101 4.82842712,23.7989899 9.51471863,28.4852814 C11.9850564,30.9556191 15.264488,32.1237398 18.5,31.9896435 L33.9948134,32 C35.3783898,32 36.5,33.1096621 36.5,34.5 C36.5,35.8807119 35.3906622,37 33.9948134,37 L18.0051866,37 C13.65181,37.0009495 9.29959083,35.3412214 5.97918472,32.0208153 Z M17.5,19 C17.5,17.6192881 18.6176026,16.5 20.0034561,16.5 L33.9965439,16.5 C35.3791645,16.5 36.5,17.6096621 36.5,19 C36.5,20.3807119 35.3823974,21.5 33.9965439,21.5 L20.0034561,21.5 C18.6208355,21.5 17.5,20.3903379 17.5,19 Z"
:id "shape"}]]]]) :id "shape"}]]]])
(defn dropdown-icon []
[:svg
{:width "16px"
:height "16px"
:viewBox "0 0 16 16"
:version "1.1"}
[:g
{:id "page-1"
:stroke "none"
:stroke-width "1"
:fill "none"
:fill-rule "evenodd"}
[:g
{:id "commiteth-desktop_repositories"
:transform "translate(-1098.000000, -32.000000)"
:fill "#FFFFFF"}
[:g {:id "header"}
[:g {:id "user" :transform "translate(956.000000, 24.000000)"}
[:g
{:id "icon_dropdown"
:transform "translate(142.000000, 8.000000)"}
[:path
{:d "M7.76596419,11.5564843 C8.07705085,11.6115965 8.40862642,11.5177766 8.64937808,11.277025 L13.3038251,6.62257794 C13.6942764,6.23212667 13.695553,5.59768507 13.3050287,5.20716078 C12.9117818,4.81391382 12.2808006,4.81717535 11.8896116,5.20836438 L7.76949482,9.32848112 L3.64937808,5.20836438 C3.25892681,4.81791311 2.62448521,4.81663648 2.23396092,5.20716078 C1.84071396,5.60040773 1.84397549,6.23138892 2.23516452,6.62257794 L6.88961157,11.277025 C7.12783981,11.5152532 7.45689724,11.6086052 7.76596419,11.5564843 L7.76596419,11.5564843 Z"
:id "shape"}]]]]]]])

View File

@ -81,10 +81,6 @@
color: #848e91; color: #848e91;
} }
span.dropdown.icon {
content: url("/img/icon_dropdown.svg");
}
.user-component { .user-component {
margin-top: 0px!important; margin-top: 0px!important;
} }