coolstrap-generator 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.DS_Store +0 -0
- data/.gitignore +4 -0
- data/.rvmrc +1 -0
- data/Gemfile +4 -0
- data/Rakefile +6 -0
- data/bin/coolstrap +5 -0
- data/coolstrap-generator.gemspec +42 -0
- data/lib/.DS_Store +0 -0
- data/lib/coolstrap-generator.rb +39 -0
- data/lib/coolstrap-generator/.DS_Store +0 -0
- data/lib/coolstrap-generator/builder/middleman.rb +0 -0
- data/lib/coolstrap-generator/cli.rb +71 -0
- data/lib/coolstrap-generator/generate/project.rb +96 -0
- data/lib/coolstrap-generator/generate/view.rb +54 -0
- data/lib/coolstrap-generator/logger.rb +13 -0
- data/lib/coolstrap-generator/middleman/helpers.rb +176 -0
- data/lib/coolstrap-generator/templates/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/assets/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/assets/fonts/fontawesome-webfont.eot +0 -0
- data/lib/coolstrap-generator/templates/app/assets/fonts/fontawesome-webfont.svg +255 -0
- data/lib/coolstrap-generator/templates/app/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/lib/coolstrap-generator/templates/app/assets/fonts/fontawesome-webfont.woff +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/arrow-list.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/arrow.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/menu.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/startup/smatphone.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/startup/smatphone@2x.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/startup/tablet-landscape.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/startup/tablet-landscape@2x.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/startup/tablet-portrait.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/coolstrap/startup/tablet-portrait@2x.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/startup/smatphone.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/startup/smatphone@2x.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/startup/tablet-landscape.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/startup/tablet-landscape@2x.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/startup/tablet-portrait.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/images/startup/tablet-portrait@2x.png +0 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/app.js +18 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/_Coolstrap.App.coffee +39 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/_Coolstrap.Console.coffee +49 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/_Coolstrap.Constants.coffee +89 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/_Coolstrap.js +13 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/build/_wrap-start.js +18 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/coolstrap-0.1.js +20 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/coolstrap-0.1.packed.js +23 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/fallback/_Coolstrap.Fallback.Android.coffee +53 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/fallback/_Coolstrap.Fallback.iOS.coffee +29 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/framework/_Coolstrap.Framework.Articles.coffee +34 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/framework/_Coolstrap.Framework.Dialogs.coffee +33 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/framework/_Coolstrap.Framework.Navigation.coffee +118 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/framework/_Coolstrap.Framework.Sections.coffee +60 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/lib/iscroll.js +1076 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/lib/modernizr-2.5.3.js +1265 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/lib/zepto-1.0rc1.js +1357 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/navigate/_Coolstrap.Navigate.History.coffee +164 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/navigate/_Coolstrap.Navigate.coffee +105 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/plugins/_Coolstrap.Plugins.coffee +157 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/util/_Coolstrap.Util.Core.coffee +54 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/util/_Coolstrap.Util.Platform.coffee +89 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/util/_Coolstrap.Util.UI.coffee +96 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/util/_Coolstrap.Util.coffee +41 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/view/_Coolstrap.View.Article.coffee +43 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/view/_Coolstrap.View.Aside.coffee +65 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/view/_Coolstrap.View.Dialog.coffee +129 -0
- data/lib/coolstrap-generator/templates/app/assets/javascripts/coolstrap/view/_Coolstrap.View.Scroll.coffee +191 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/_structure.scss +8 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/coolstrap.css.scss +2 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/_components.scss +5 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/_layout.scss +4 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/_utilities.scss +6 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/components/_dialog.scss +122 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/components/_formelements.scss +89 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/components/_listview.scss +76 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/components/_navigations.scss +192 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/components/_tools.scss +169 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/layout/_layers.scss +57 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/layout/_layout.scss +62 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/layout/_positions.scss +38 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/layout/_transitions.scss +35 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/utilities/_animate.scss +63 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/utilities/_helpers.scss +82 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/utilities/_icons.scss +336 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/utilities/_mixins.scss +45 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/utilities/_reset.scss +367 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/structure/utilities/_variables.scss +176 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/themes/_default.scss +255 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/coolstrap/themes/coolstrap.css.scss +164 -0
- data/lib/coolstrap-generator/templates/app/assets/stylesheets/customtheme.css.scss +19 -0
- data/lib/coolstrap-generator/templates/app/components/_formelements.html.haml +130 -0
- data/lib/coolstrap-generator/templates/app/components/_tabbar.html.haml +343 -0
- data/lib/coolstrap-generator/templates/app/components/_toolbar.html.haml +463 -0
- data/lib/coolstrap-generator/templates/app/components/formelements.html.haml +196 -0
- data/lib/coolstrap-generator/templates/app/components/listview/_complexlistavatar.html.haml.erb +77 -0
- data/lib/coolstrap-generator/templates/app/components/listview/_simplelist.html.haml.erb +31 -0
- data/lib/coolstrap-generator/templates/app/components/tabbar.html.haml.erb +16 -0
- data/lib/coolstrap-generator/templates/app/components/toolbar.html.haml.erb +32 -0
- data/lib/coolstrap-generator/templates/app/index.html.haml.erb +21 -0
- data/lib/coolstrap-generator/templates/app/layout.haml.erb +79 -0
- data/lib/coolstrap-generator/templates/app/views/.DS_Store +0 -0
- data/lib/coolstrap-generator/templates/app/views/_home.haml.erb +31 -0
- data/lib/coolstrap-generator/templates/app/views/shared/_aside_onbottom.haml +2 -0
- data/lib/coolstrap-generator/templates/app/views/shared/_aside_onleft.haml +56 -0
- data/lib/coolstrap-generator/templates/app/views/shared/_aside_onright.haml +66 -0
- data/lib/coolstrap-generator/templates/app/views/shared/_aside_ontop.haml +19 -0
- data/lib/coolstrap-generator/templates/defaults/Gemfile.erb +3 -0
- data/lib/coolstrap-generator/templates/defaults/LICENSE.erb +1 -0
- data/lib/coolstrap-generator/templates/defaults/Readme.mkd.erb +1 -0
- data/lib/coolstrap-generator/templates/defaults/config.erb +42 -0
- data/lib/coolstrap-generator/templates/defaults/gitignore.erb +2 -0
- data/lib/coolstrap-generator/templates/rakefile +102 -0
- data/lib/coolstrap-generator/templates/specs/app_spec.coffee +3 -0
- data/lib/coolstrap-generator/utils.rb +82 -0
- data/lib/coolstrap-generator/version.rb +5 -0
- data/readme.md +107 -0
- data/spec/cli/command_spec.rb +88 -0
- data/spec/coolstrap-generator/generate/project_spec.rb +126 -0
- data/spec/coolstrap-generator/generate/view_spec.rb +26 -0
- data/spec/coolstrap-generator/logger_spec.rb +25 -0
- data/spec/coolstrap-generator/middleman/helpers_spec.rb +16 -0
- data/spec/coolstrap-generator/utils_spec.rb +120 -0
- data/spec/spec_helper.rb +39 -0
- metadata +321 -0
@@ -0,0 +1,191 @@
|
|
1
|
+
###
|
2
|
+
* Wrapper of the third library iScroll
|
3
|
+
* Inspired by LungoJS
|
4
|
+
*
|
5
|
+
* @namespace COOLSTRAP.View
|
6
|
+
* @class Scroll
|
7
|
+
* @requires iScroll
|
8
|
+
*
|
9
|
+
* @author Abraham Barrera <abarrerac@gmail.com> || @abraham_barrera
|
10
|
+
###
|
11
|
+
|
12
|
+
COOLSTRAP.View.Scroll = ((cool) ->
|
13
|
+
CLASS = cool.Constants.CLASS
|
14
|
+
ATTRIBUTE = cool.Constants.ATTRIBUTE
|
15
|
+
ERROR = cool.Constants.ERROR
|
16
|
+
EXCLUDE_ELEMENT = "p"
|
17
|
+
DEFAULT_PROPERTIES =
|
18
|
+
hScroll: false
|
19
|
+
vScroll: false
|
20
|
+
useTransition: true
|
21
|
+
momentum: true
|
22
|
+
lockDirection: true
|
23
|
+
fixedScrollbar: true
|
24
|
+
fadeScrollbar: true
|
25
|
+
hideScrollbar: true
|
26
|
+
|
27
|
+
SCROLLS = {}
|
28
|
+
SCROLL_TIMEFRAME = 250
|
29
|
+
NOID_COUNTER = 0
|
30
|
+
_preventEditInputs = (e) ->
|
31
|
+
target = e.target
|
32
|
+
target = target.parentNode until target.nodeType is 1
|
33
|
+
e.preventDefault() if target.tagName isnt "SELECT" and target.tagName isnt "INPUT" and target.tagName isnt "TEXTAREA"
|
34
|
+
|
35
|
+
###
|
36
|
+
* Creates a new iScroll element.
|
37
|
+
*
|
38
|
+
* @method init
|
39
|
+
*
|
40
|
+
* @param {dom} element of the container scroll.
|
41
|
+
* @param {object} [OPTIONAL] Properties
|
42
|
+
###
|
43
|
+
init = (element, properties) ->
|
44
|
+
scroll_id = element.attr(ATTRIBUTE.ID)
|
45
|
+
if not scroll_id or scroll_id is ""
|
46
|
+
NOID_COUNTER++
|
47
|
+
scroll_id = CLASS.SCROLLABLE + NOID_COUNTER
|
48
|
+
element.attr ATTRIBUTE.ID, scroll_id
|
49
|
+
if element.children().length > 1 or element.children().length is 0
|
50
|
+
inner_html = element.html()
|
51
|
+
inner_element = cool.dom("<div class=\"scroll_container\"></div>")
|
52
|
+
inner_element.append inner_html
|
53
|
+
element.html inner_element
|
54
|
+
if scroll_id
|
55
|
+
_render scroll_id, properties
|
56
|
+
else
|
57
|
+
cool.Console.log ERROR.CREATE_SCROLL
|
58
|
+
|
59
|
+
|
60
|
+
###
|
61
|
+
* Update iScroll element with new <markup> content.
|
62
|
+
*
|
63
|
+
* @method html
|
64
|
+
*
|
65
|
+
* @param {string} Id of the container scroll.
|
66
|
+
* @param {string} Markup content
|
67
|
+
###
|
68
|
+
html = (id, content) ->
|
69
|
+
container = _getContainer(id)
|
70
|
+
container.html content
|
71
|
+
_render id
|
72
|
+
|
73
|
+
|
74
|
+
###
|
75
|
+
* Add <markup> content to iScroll instance
|
76
|
+
*
|
77
|
+
* @method append
|
78
|
+
*
|
79
|
+
* @param {string} Id of the container scroll.
|
80
|
+
* @param {string} Markup content
|
81
|
+
###
|
82
|
+
append = (id, content) ->
|
83
|
+
container = _getContainer(id)
|
84
|
+
container.append content
|
85
|
+
_render id
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
###
|
90
|
+
* Refresh iScroll instance.
|
91
|
+
*
|
92
|
+
* @method refresh
|
93
|
+
*
|
94
|
+
* @param {string} Id of the container scroll.
|
95
|
+
* @param {object} [OPTIONAL] Properties
|
96
|
+
###
|
97
|
+
refresh = (id, properties) ->
|
98
|
+
_render id, properties
|
99
|
+
|
100
|
+
###
|
101
|
+
* Removes iScroll instance.
|
102
|
+
*
|
103
|
+
* @method remove
|
104
|
+
*
|
105
|
+
* @param {string} Id of the container scroll.
|
106
|
+
###
|
107
|
+
remove = (id) ->
|
108
|
+
delete SCROLLS[id] if SCROLLS[id]
|
109
|
+
|
110
|
+
|
111
|
+
###
|
112
|
+
* Scrolls the wrapper contents to the minimum x/y coordinates
|
113
|
+
*
|
114
|
+
* @method first
|
115
|
+
*
|
116
|
+
* @param {string} Id of the <section>
|
117
|
+
###
|
118
|
+
first = (id) ->
|
119
|
+
SCROLLS[id].scrollTo 0, 0, SCROLL_TIMEFRAME if SCROLLS[id]
|
120
|
+
|
121
|
+
###
|
122
|
+
* Scrolls the wrapper contents to the maximum x/y coordinate
|
123
|
+
*
|
124
|
+
* @method down
|
125
|
+
*
|
126
|
+
* @param {string} Id of the <section>
|
127
|
+
###
|
128
|
+
last = (id) ->
|
129
|
+
scroll = SCROLLS[id]
|
130
|
+
if scroll
|
131
|
+
element = cool.dom("#" + id).first()
|
132
|
+
content_width = 0
|
133
|
+
content_height = 0
|
134
|
+
if _isHorizontal(element)
|
135
|
+
content_width = -(_sizeProperty(element, ATTRIBUTE.WIDTH))
|
136
|
+
else
|
137
|
+
content_height = -(_sizeProperty(element, ATTRIBUTE.HEIGHT))
|
138
|
+
scroll.scrollTo content_width, content_height, SCROLL_TIMEFRAME
|
139
|
+
|
140
|
+
_getContainer = (id) ->
|
141
|
+
scroll = cool.dom("#" + id)
|
142
|
+
container = scroll.children().first()
|
143
|
+
if container.length is 0
|
144
|
+
scroll.html "<div></div>"
|
145
|
+
container = scroll.children().first()
|
146
|
+
container
|
147
|
+
|
148
|
+
_sizeProperty = (element, property) ->
|
149
|
+
element_content = element.children().first()
|
150
|
+
element_content[property]() - element[property]()
|
151
|
+
|
152
|
+
_render = (id, properties) ->
|
153
|
+
scroll = cool.dom("#" + id)
|
154
|
+
properties = _mixProperties(scroll, properties)
|
155
|
+
_saveScrollInCache id, properties
|
156
|
+
|
157
|
+
_needScroll = (scroll, properties) ->
|
158
|
+
element = scroll[0]
|
159
|
+
is_horizontal = _isHorizontal(cool.dom(element))
|
160
|
+
if is_horizontal
|
161
|
+
element.clientWidth < element.scrollWidth
|
162
|
+
else
|
163
|
+
element.clientHeight < element.scrollHeight
|
164
|
+
|
165
|
+
_saveScrollInCache = (id, properties) ->
|
166
|
+
unless SCROLLS[id]
|
167
|
+
SCROLLS[id] = new iScroll(id, properties)
|
168
|
+
else
|
169
|
+
SCROLLS[id].refresh()
|
170
|
+
|
171
|
+
_mixProperties = (scroll, properties) ->
|
172
|
+
scroll_type = (if _isHorizontal(scroll) then "hScroll" else "vScroll")
|
173
|
+
properties or (properties = {})
|
174
|
+
properties[scroll_type] = true
|
175
|
+
properties = cool.Util.Core.extend(DEFAULT_PROPERTIES, properties)
|
176
|
+
properties = cool.Util.Core.extend(properties,
|
177
|
+
onBeforeScrollStart: _preventEditInputs
|
178
|
+
)
|
179
|
+
properties
|
180
|
+
|
181
|
+
_isHorizontal = (scroll) ->
|
182
|
+
(if (scroll.hasClass(CLASS.HORIZONTAL)) then true else false)
|
183
|
+
|
184
|
+
init: init
|
185
|
+
remove: remove
|
186
|
+
refresh: refresh
|
187
|
+
html: html
|
188
|
+
append: append
|
189
|
+
first: first
|
190
|
+
last: last
|
191
|
+
)(COOLSTRAP)
|
Binary file
|
@@ -0,0 +1,8 @@
|
|
1
|
+
@import "compass";
|
2
|
+
$experimental-support-for-mozilla: false;
|
3
|
+
$experimental-support-for-opera: false;
|
4
|
+
$experimental-support-for-microsoft: false;
|
5
|
+
$experimental-support-for-khtml: false;
|
6
|
+
@import "structure/utilities";
|
7
|
+
@import "structure/layout";
|
8
|
+
@import "structure/components";
|
@@ -0,0 +1,122 @@
|
|
1
|
+
div#{$isDialog} {
|
2
|
+
@include setFlexibleBox(vertical,stretch,start);
|
3
|
+
@include box-flex(1);
|
4
|
+
text-align: center;
|
5
|
+
|
6
|
+
> * { margin: 0; }
|
7
|
+
|
8
|
+
> a, div, input { @include box-flex(1); }
|
9
|
+
|
10
|
+
> *:not(:first-child) { margin-top: $default-content-spacing; }
|
11
|
+
|
12
|
+
a {
|
13
|
+
@include setFlexibleBox;
|
14
|
+
@include box-flex(1);
|
15
|
+
}
|
16
|
+
|
17
|
+
h1 { font-size: 15px; }
|
18
|
+
input { display: block; }
|
19
|
+
|
20
|
+
.button-group + a,
|
21
|
+
a + .button-group,
|
22
|
+
.button-group + .button-group {
|
23
|
+
margin-top: $default-action-spacing;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
div#{$isAction} {
|
28
|
+
width: 100%;
|
29
|
+
position: absolute;
|
30
|
+
padding: $default-action-spacing;
|
31
|
+
a { height: $default-action-button; }
|
32
|
+
&.onTop { top: 0; }
|
33
|
+
&:not(.onTop) { bottom: 0; }
|
34
|
+
}
|
35
|
+
|
36
|
+
div#{$isAlert} {
|
37
|
+
width: $default-alert-size;
|
38
|
+
max-width: 90%;
|
39
|
+
padding: $default-alert-spacing;
|
40
|
+
position: absolute;
|
41
|
+
a { height: $default-alert-button; }
|
42
|
+
}
|
43
|
+
|
44
|
+
div#{$isModal} {
|
45
|
+
position: absolute;
|
46
|
+
top: $default-modal-spacing;
|
47
|
+
bottom: $default-modal-spacing;
|
48
|
+
left: $default-modal-spacing;
|
49
|
+
right: $default-modal-spacing;
|
50
|
+
.close {
|
51
|
+
position: absolute;
|
52
|
+
top: -10px;
|
53
|
+
right: -10px;
|
54
|
+
display: inline-block;
|
55
|
+
padding: 5px 10px;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
div#{$isPopover} {
|
60
|
+
//TODO Pasar calculos de la posicion de la flecha al JS
|
61
|
+
position: absolute;
|
62
|
+
max-height: $default-dialog-maxheight;
|
63
|
+
max-width: $default-dialog-maxwidth;
|
64
|
+
|
65
|
+
$carret-front-size: $default-popover-arrow;
|
66
|
+
$carret-back-size: $default-popover-arrow + $default-popover-border;
|
67
|
+
|
68
|
+
$carret-front-position: -($carret-front-size * 2 - $default-popover-border);
|
69
|
+
$carret-back-position: -($carret-back-size * 2 - $default-popover-border);
|
70
|
+
|
71
|
+
&:after,
|
72
|
+
&:before {
|
73
|
+
content: "";
|
74
|
+
display: block;
|
75
|
+
position: absolute;
|
76
|
+
border-style: solid;
|
77
|
+
border-color: transparent;
|
78
|
+
width: 0;
|
79
|
+
height: 0;
|
80
|
+
}
|
81
|
+
&:after {
|
82
|
+
border-width: $carret-front-size;
|
83
|
+
}
|
84
|
+
&:before {
|
85
|
+
border-width: $carret-back-size;
|
86
|
+
}
|
87
|
+
|
88
|
+
&.onbottom,
|
89
|
+
&.ontop {
|
90
|
+
&:after { left: 50%; margin-left: -($carret-front-size); }
|
91
|
+
&:before { left: 50%; margin-left: -($carret-back-size); }
|
92
|
+
}
|
93
|
+
&.onleft,
|
94
|
+
&.onright {
|
95
|
+
&:after { top: 50%; margin-top: -($carret-front-size); }
|
96
|
+
|
97
|
+
&:before { top: 50%; margin-top: -($carret-back-size); }
|
98
|
+
}
|
99
|
+
|
100
|
+
&.onbottom {
|
101
|
+
&:after { top: $carret-front-position; border-bottom-color: red; }
|
102
|
+
&:before { top: $carret-back-position; border-bottom-color: green; }
|
103
|
+
}
|
104
|
+
&.onleft {
|
105
|
+
&:after { right: $carret-front-position; border-left-color: red; }
|
106
|
+
&:before { right: $carret-back-position; border-left-color: green; }
|
107
|
+
}
|
108
|
+
&.ontop {
|
109
|
+
&:after { bottom: $carret-front-position; border-top-color: red; }
|
110
|
+
&:before { bottom: $carret-back-position; border-top-color: green; }
|
111
|
+
}
|
112
|
+
&.onright {
|
113
|
+
&:after { left: $carret-front-position; border-right-color: red; }
|
114
|
+
&:before { left: $carret-back-position; border-right-color: green; }
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
@@ -0,0 +1,89 @@
|
|
1
|
+
|
2
|
+
form {
|
3
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]) {
|
4
|
+
-webkit-appearance: none;
|
5
|
+
}
|
6
|
+
input:not([type="checkbox"]):not([type="radio"]),
|
7
|
+
select {
|
8
|
+
height: $default-header-button;
|
9
|
+
padding: 0 $default-interface-spacing;
|
10
|
+
}
|
11
|
+
label {
|
12
|
+
display: block;
|
13
|
+
line-height: $default-header-button;
|
14
|
+
}
|
15
|
+
.content {
|
16
|
+
@include setFlexibleBox(vertical,stretch, center);
|
17
|
+
min-height: 44px;
|
18
|
+
padding: $default-interface-spacing;
|
19
|
+
i {
|
20
|
+
@include square($default-tabbar-icon);
|
21
|
+
line-height: $default-tabbar-icon;
|
22
|
+
font-size: $default-tabbar-icon;
|
23
|
+
}
|
24
|
+
.aside {
|
25
|
+
width: 30%;
|
26
|
+
text-align: right;
|
27
|
+
padding-right: $default-interface-spacing * 2;
|
28
|
+
}
|
29
|
+
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
|
30
|
+
textarea,
|
31
|
+
select, {
|
32
|
+
@include box-flex(1);
|
33
|
+
display: block;
|
34
|
+
}
|
35
|
+
label, .slider { @include box-flex(1); }
|
36
|
+
textarea {
|
37
|
+
padding: $default-interface-spacing;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
.stack {
|
42
|
+
label {
|
43
|
+
line-height: normal;
|
44
|
+
input, textarea, select { width: 100%; }
|
45
|
+
}
|
46
|
+
}
|
47
|
+
.horizontal {
|
48
|
+
@include setFlexibleBox(horizontal,center, stretch);
|
49
|
+
@include clearfix;
|
50
|
+
label {
|
51
|
+
@include box-flex();
|
52
|
+
@include clearfix;
|
53
|
+
height: $default-header-button;
|
54
|
+
line-height: $default-header-button;
|
55
|
+
input {
|
56
|
+
height: $default-header-button;
|
57
|
+
float: right;
|
58
|
+
}
|
59
|
+
input[type="radio"], input[type="checkbox"] { margin-right: 1px; }
|
60
|
+
}
|
61
|
+
.slider { @include box-flex(1) }
|
62
|
+
i {
|
63
|
+
display: block;
|
64
|
+
float: right;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
li .content.horizontal {
|
68
|
+
padding: 0 !important;
|
69
|
+
}
|
70
|
+
.start { @include setFlexibleBox(horizontal,start, stretch); }
|
71
|
+
}
|
72
|
+
.horizontal {
|
73
|
+
@include setFlexibleBox(horizontal,center, stretch);
|
74
|
+
@include clearfix;
|
75
|
+
label {
|
76
|
+
@include box-flex();
|
77
|
+
@include clearfix;
|
78
|
+
input {
|
79
|
+
float: right;
|
80
|
+
height: 20px;
|
81
|
+
}
|
82
|
+
input[type="radio"], input[type="checkbox"] {
|
83
|
+
@include box-flex();
|
84
|
+
margin-right: 1px;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
|
89
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
@import "../utilities";
|
2
|
+
|
3
|
+
ul[data-type="listview"] {
|
4
|
+
list-style-type: none;
|
5
|
+
margin: 0;
|
6
|
+
padding: 0;
|
7
|
+
li,
|
8
|
+
li > a {
|
9
|
+
@include setFlexibleBox(horizontal,stretch, stretch);
|
10
|
+
padding: $default-listview-spacing;
|
11
|
+
}
|
12
|
+
li > a, {
|
13
|
+
margin: -($default-listview-spacing);
|
14
|
+
}
|
15
|
+
|
16
|
+
li {
|
17
|
+
> div,
|
18
|
+
a > div,
|
19
|
+
.nested > div {
|
20
|
+
margin-left: $default-listview-spacing;
|
21
|
+
&:first-child {
|
22
|
+
margin-left: 0;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
26
|
+
|
27
|
+
div {
|
28
|
+
@include setFlexibleBox(vertical,stretch,center);
|
29
|
+
}
|
30
|
+
.nested {
|
31
|
+
@include setFlexibleBox;
|
32
|
+
}
|
33
|
+
.content {
|
34
|
+
* {
|
35
|
+
margin: 0;
|
36
|
+
padding: 0;
|
37
|
+
}
|
38
|
+
> * + * {
|
39
|
+
margin-top: 7px;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
.content,
|
43
|
+
.nested > *:first-child,
|
44
|
+
li > a {
|
45
|
+
@include box-flex(1);
|
46
|
+
}
|
47
|
+
i { @include inline-block; }
|
48
|
+
input {
|
49
|
+
@include box-flex(1);
|
50
|
+
display: block;
|
51
|
+
}
|
52
|
+
.aside {
|
53
|
+
* + i { margin-left: $default-interface-spacing; }
|
54
|
+
}
|
55
|
+
|
56
|
+
&.inset {
|
57
|
+
margin: 10px;
|
58
|
+
}
|
59
|
+
.up { @include box-pack(start); }
|
60
|
+
.stretch {
|
61
|
+
margin-top: -($default-listview-spacing);
|
62
|
+
margin-bottom: -($default-listview-spacing);
|
63
|
+
&:first-child { margin-left: -($default-listview-spacing) !important; }
|
64
|
+
}
|
65
|
+
.vertical {
|
66
|
+
@include setFlexibleBox(vertical,center,center);
|
67
|
+
i, span {
|
68
|
+
display: block;
|
69
|
+
}
|
70
|
+
* + * {
|
71
|
+
margin-top: 7px;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
|