Created
April 11, 2014 02:41
-
-
Save kurogelee/10438125 to your computer and use it in GitHub Desktop.
LightTableのプラグイン形式によるスキン作成 ref: http://qiita.com/kurogelee/items/ba03d173ba412adac6c4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(cmd/command {:command :コマンド名 | |
:hidden true ; trueだとCommandsに現れない | |
:desc "ポップアップで現れる説明" | |
:exec #(do ...)}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(object/tag-behaviors :app [(list :lt.objs.style/set-skin skin)]) | |
(object/tag-behaviors :editor [(list :lt.objs.style/set-theme theme)]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@import url("light-base.css"); | |
body:before { | |
z-index: -1; | |
position: absolute; | |
top: 0; | |
left: 0; | |
content: url("../img/cocoa_1920.jpg"); | |
-webkit-transform: scale(1.0) translate(0px, 0px); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root .skin-rabbit-house-light-1, | |
:root .skin-rabbit-house-light-2, | |
:root .skin-rabbit-house-light-3, | |
:root .skin-rabbit-house-light-4, | |
:root .skin-rabbit-house-light-5 { | |
var-bg: rgba(59,63,65,0.8); | |
var-fg: #eee; | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root .skin-dark, :root .skin-light { | |
var-bg: #3b3f41; | |
var-fg: #ccc; | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:+ {:app {"ctrl-alt-shift-1" [:set-skin-rabbit-house-light-1] | |
"ctrl-alt-shift-2" [:set-skin-rabbit-house-light-2] | |
"ctrl-alt-shift-3" [:set-skin-rabbit-house-light-3] | |
"ctrl-alt-shift-4" [:set-skin-rabbit-house-light-4] | |
"ctrl-alt-shift-5" [:set-skin-rabbit-house-light-5] | |
}}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:+ {:app [(:lt.objs.style/provide-theme "rabbit-house-light" "theme.css") | |
(:lt.objs.style/provide-skin "rabbit-house-light-1" "skins/light-1.css") | |
(:lt.objs.style/provide-skin "rabbit-house-light-2" "skins/light-2.css") | |
(:lt.objs.style/provide-skin "rabbit-house-light-3" "skins/light-3.css") | |
(:lt.objs.style/provide-skin "rabbit-house-light-4" "skins/light-4.css") | |
(:lt.objs.style/provide-skin "rabbit-house-light-5" "skins/light-5.css") | |
(:lt.objs.plugins/load-js "theme_rabbit_house_compiled.js") | |
(:lt.objs.plugins/load-keymap "plugin.keymap")]}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns lt.plugins.theme-rabbit-house | |
(:require [lt.object :as object] | |
[lt.objs.tabs :as tabs] | |
[lt.objs.command :as cmd] | |
[lt.objs.style :as style] | |
[lt.objs.settings :as settings]) | |
(:require-macros [lt.macros :refer [defui behavior]])) | |
(def plugin-name "theme-rabbit-house") | |
(def theme "rabbit-house-light") | |
(def base-name "rabbit-house-light") | |
(defn skin-command [name] | |
(let [skin (str base-name "-" name)] | |
(cmd/command {:command (keyword (str "set-skin-" skin)) | |
:hidden true | |
:desc (str plugin-name ": set skin " skin) | |
:exec #(do | |
(let [cur-skin (:skin @style/styles)] | |
(when-not (= skin cur-skin) | |
(object/remove-tag-behaviors :app [(list :lt.objs.style/set-skin cur-skin)]) | |
(object/tag-behaviors :app [(list :lt.objs.style/set-skin skin)]))) | |
(let [cur-theme (:theme @style/styles)] | |
(when-not (= theme cur-theme) | |
(object/remove-tag-behaviors :editor [(list :lt.objs.style/set-theme cur-theme)]) | |
(object/tag-behaviors :editor [(list :lt.objs.style/set-theme theme)]))))}))) | |
(doseq [n (range 1 6)] (skin-command n)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment