styleyt 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +2 -2
- data/VERSION +1 -1
- data/templates/images/16x16/add.png +0 -0
- data/templates/images/16x16/edit.png +0 -0
- data/templates/images/16x16/index.png +0 -0
- data/templates/images/16x16/remove.png +0 -0
- data/templates/images/22x22/arrow-right.png +0 -0
- data/templates/images/22x22/edit.png +0 -0
- data/templates/images/22x22/insert_booking.png +0 -0
- data/templates/images/22x22/remove.png +0 -0
- data/templates/images/32x32/edit.png +0 -0
- data/templates/images/32x32/remove.png +0 -0
- data/templates/images/favicon.ico +0 -0
- data/templates/images/logo.png +0 -0
- data/templates/preview/index.html.haml +62 -0
- data/templates/stylesheets/ie.scss +8 -0
- data/templates/stylesheets/ie6.scss +7 -0
- data/templates/stylesheets/partials/_application.sass +0 -0
- data/templates/stylesheets/partials/_base.sass +38 -0
- data/templates/stylesheets/partials/_content.sass +107 -0
- data/templates/stylesheets/partials/_cyt.sass +173 -0
- data/templates/stylesheets/partials/_formtastic.sass +203 -0
- data/templates/stylesheets/partials/_formtastic_cyt.sass +68 -0
- data/templates/stylesheets/partials/_header.sass +28 -0
- data/templates/stylesheets/partials/_invoice.sass +187 -0
- data/templates/stylesheets/partials/_jquery.sass +2 -0
- data/templates/stylesheets/partials/_layout.sass +19 -0
- data/templates/stylesheets/partials/_navigation.sass +2 -0
- data/templates/stylesheets/partials/_pagination.sass +61 -0
- data/templates/stylesheets/partials/_redmine.sass +270 -0
- data/templates/stylesheets/partials/_scaffold.sass +67 -0
- data/templates/stylesheets/partials/_sidebar.sass +5 -0
- data/templates/stylesheets/partials/content/_ajax_indicator.sass +27 -0
- data/templates/stylesheets/partials/content/_fancy_buttons.sass +10 -0
- data/templates/stylesheets/partials/content/_flash_errors.sass +45 -0
- data/templates/stylesheets/partials/content/_icons.sass +16 -0
- data/templates/stylesheets/partials/content/_overview.sass +37 -0
- data/templates/stylesheets/partials/content/_table_list.sass +23 -0
- data/templates/stylesheets/partials/formtastic/_formtastic_base.sass +624 -0
- data/templates/stylesheets/partials/jquery/_jquery_ui.sass +1473 -0
- data/templates/stylesheets/partials/jquery/_tooltip.sass +13 -0
- data/templates/stylesheets/partials/navigation/_main.sass +33 -0
- data/templates/stylesheets/partials/navigation/_sidebar.sass +18 -0
- data/templates/stylesheets/print.sass +30 -0
- data/templates/stylesheets/print.scss +26 -0
- data/templates/stylesheets/screen.scss +25 -0
- data/templates/stylesheets/themes/default/colors.sass +9 -0
- data/templates/stylesheets/themes/red/colors.sass +0 -0
- data/templates/test.css +0 -0
- metadata +53 -12
@@ -0,0 +1,67 @@
|
|
1
|
+
body
|
2
|
+
background-color: white
|
3
|
+
color: #333333
|
4
|
+
font-family: verdana, arial, helvetica, sans-serif
|
5
|
+
font-size: 13px
|
6
|
+
line-height: 18px
|
7
|
+
|
8
|
+
p, ol, ul, td
|
9
|
+
font-family: verdana, arial, helvetica, sans-serif
|
10
|
+
font-size: 13px
|
11
|
+
line-height: 18px
|
12
|
+
|
13
|
+
pre
|
14
|
+
background-color: #eeeeee
|
15
|
+
padding: 10px
|
16
|
+
font-size: 11px
|
17
|
+
|
18
|
+
a
|
19
|
+
color: black
|
20
|
+
&:visited
|
21
|
+
color: #666666
|
22
|
+
&:hover
|
23
|
+
color: white
|
24
|
+
background-color: black
|
25
|
+
|
26
|
+
.fieldWithErrors
|
27
|
+
padding: 2px
|
28
|
+
background-color: red
|
29
|
+
display: table
|
30
|
+
|
31
|
+
#errorExplanation
|
32
|
+
width: 400px
|
33
|
+
border: 2px solid red
|
34
|
+
padding: 7px
|
35
|
+
padding-bottom: 12px
|
36
|
+
margin-bottom: 20px
|
37
|
+
background-color: #f0f0f0
|
38
|
+
h2
|
39
|
+
text-align: left
|
40
|
+
font-weight: bold
|
41
|
+
padding: 5px 5px 5px 15px
|
42
|
+
font-size: 12px
|
43
|
+
margin: -7px
|
44
|
+
background-color: #cc0000
|
45
|
+
color: white
|
46
|
+
p
|
47
|
+
color: #333333
|
48
|
+
margin-bottom: 0
|
49
|
+
padding: 5px
|
50
|
+
ul li
|
51
|
+
font-size: 12px
|
52
|
+
list-style: square
|
53
|
+
|
54
|
+
div
|
55
|
+
&.uploadStatus
|
56
|
+
margin: 5px
|
57
|
+
&.progressBar
|
58
|
+
margin: 5px
|
59
|
+
div
|
60
|
+
&.border
|
61
|
+
background-color: white
|
62
|
+
border: 1px solid grey
|
63
|
+
width: 100%
|
64
|
+
&.background
|
65
|
+
background-color: #333333
|
66
|
+
height: 18px
|
67
|
+
width: 0%
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// Snippet from Redmine.css
|
2
|
+
// Ajax indicator *****
|
3
|
+
#ajax-indicator
|
4
|
+
position: absolute
|
5
|
+
/* fixed not supported by IE
|
6
|
+
background-color: #eeeeee
|
7
|
+
border: 1px solid #bbbbbb
|
8
|
+
top: 35%
|
9
|
+
left: 40%
|
10
|
+
width: 20%
|
11
|
+
font-weight: bold
|
12
|
+
text-align: center
|
13
|
+
padding: 0.6em
|
14
|
+
z-index: 100
|
15
|
+
filter: alpha(opacity = 50)
|
16
|
+
opacity: 0.5
|
17
|
+
|
18
|
+
html>body #ajax-indicator
|
19
|
+
position: fixed
|
20
|
+
|
21
|
+
#ajax-indicator span
|
22
|
+
background-position: 0% 40%
|
23
|
+
background-repeat: no-repeat
|
24
|
+
background-image: url(../../images/loading.gif)
|
25
|
+
padding-left: 26px
|
26
|
+
vertical-align: bottom
|
27
|
+
// End of snippet
|
@@ -0,0 +1,45 @@
|
|
1
|
+
// Snippet from Redmine.css
|
2
|
+
// Flash & error messages ***
|
3
|
+
|
4
|
+
#errorExplanation, div.flash, .nodata, .warning
|
5
|
+
padding: 4px 4px 4px 30px
|
6
|
+
margin-bottom: 12px
|
7
|
+
font-size: 1.1em
|
8
|
+
border: 1px solid
|
9
|
+
+border-radius($border_radius)
|
10
|
+
|
11
|
+
div.flash
|
12
|
+
margin-top: 8px
|
13
|
+
&.error
|
14
|
+
background: url(../images/false.png) 8px 5px no-repeat
|
15
|
+
background-color: #ffe3e3
|
16
|
+
border-color: #550000
|
17
|
+
color: #550000
|
18
|
+
|
19
|
+
#errorExplanation
|
20
|
+
background: url(../images/false.png) 8px 5px no-repeat
|
21
|
+
background-color: #ffe3e3
|
22
|
+
border-color: #550000
|
23
|
+
color: #550000
|
24
|
+
|
25
|
+
div.flash.notice
|
26
|
+
background: url(../images/true.png) 8px 5px no-repeat
|
27
|
+
background-color: #dfffdf
|
28
|
+
border-color: #9fcf9f
|
29
|
+
color: #005f00
|
30
|
+
|
31
|
+
div.flash.alert
|
32
|
+
background: url(../images/false.png) 8px 5px no-repeat
|
33
|
+
background-color: #ffe3e3
|
34
|
+
border-color: #550000
|
35
|
+
color: #550000
|
36
|
+
|
37
|
+
.nodata, .warning
|
38
|
+
text-align: center
|
39
|
+
background-color: #ffebc1
|
40
|
+
border-color: #fdbf3b
|
41
|
+
color: #a6750c
|
42
|
+
|
43
|
+
#errorExplanation ul
|
44
|
+
font-size: 0.9em
|
45
|
+
// End of Snippet
|
@@ -0,0 +1,16 @@
|
|
1
|
+
.icon
|
2
|
+
background-repeat: no-repeat
|
3
|
+
padding-left: 20px
|
4
|
+
text-decoration: none
|
5
|
+
font-size: 16px
|
6
|
+
color: $link_color
|
7
|
+
&:hover
|
8
|
+
color: $link_color_hover
|
9
|
+
.icon-add
|
10
|
+
background-image: url(/images/16x16/add.png)
|
11
|
+
.icon-delete
|
12
|
+
background-image: url(/images/16x16/remove.png)
|
13
|
+
.icon-edit
|
14
|
+
background-image: url(/images/16x16/edit.png)
|
15
|
+
.icon-index
|
16
|
+
background-image: url(/images/16x16/index.png)
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#overview
|
2
|
+
ul
|
3
|
+
+no-bullets
|
4
|
+
+horizontal-list
|
5
|
+
li#accounting,
|
6
|
+
li#invoicing,
|
7
|
+
li#basic_claims_data
|
8
|
+
width: 120px
|
9
|
+
li
|
10
|
+
background: no-repeat top left
|
11
|
+
padding-left: 58px
|
12
|
+
padding-right: 40px
|
13
|
+
min-height: 58px
|
14
|
+
a
|
15
|
+
border-bottom: 1px solid black
|
16
|
+
display: block
|
17
|
+
&#overview
|
18
|
+
display: none
|
19
|
+
&#store
|
20
|
+
background-image: url(/images/48x48/store.png)
|
21
|
+
&#accounting
|
22
|
+
background-image: url(/images/48x48/accounting.png)
|
23
|
+
&#invoicing
|
24
|
+
background-image: url(/images/48x48/invoicing.png)
|
25
|
+
&#basic_claims_data
|
26
|
+
background-image: url(/images/48x48/basic_claims_data.png)
|
27
|
+
&#user_settings
|
28
|
+
background-image: url(/images/48x48/user_settings.png)
|
29
|
+
ul
|
30
|
+
width: inherit
|
31
|
+
margin-top: 5px
|
32
|
+
li
|
33
|
+
padding-left: 0px
|
34
|
+
width: inherit
|
35
|
+
min-height: 1em
|
36
|
+
a
|
37
|
+
border-bottom: none
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// Based on Redmine from the redmine.css
|
2
|
+
// begin
|
3
|
+
table.list
|
4
|
+
border: 1px solid #e4e4e4
|
5
|
+
border-collapse: collapse
|
6
|
+
width: 100%
|
7
|
+
margin-bottom: 4px
|
8
|
+
th
|
9
|
+
background-color: #eeeeee
|
10
|
+
padding: 4px
|
11
|
+
white-space: nowrap
|
12
|
+
td
|
13
|
+
vertical-align: top
|
14
|
+
&.id
|
15
|
+
width: 2%
|
16
|
+
text-align: center
|
17
|
+
&.checkbox
|
18
|
+
width: 15px
|
19
|
+
padding: 0px
|
20
|
+
// end
|
21
|
+
&.action-links
|
22
|
+
text-align: right
|
23
|
+
border: 1px solid red
|
@@ -0,0 +1,624 @@
|
|
1
|
+
//
|
2
|
+
// FORMTASTIC SASS
|
3
|
+
// Flexible styling for formtastic forms
|
4
|
+
// http://www.github.com/active-stylus/formtastic-sass
|
5
|
+
//
|
6
|
+
//--------------------------------------------------------
|
7
|
+
// STACKED FORMS
|
8
|
+
// Labels fill up the full width of the form
|
9
|
+
// Inputs are on new lines
|
10
|
+
//--------------------------------------------------------
|
11
|
+
//
|
12
|
+
// Arguments:
|
13
|
+
//
|
14
|
+
// +stack-form(full-width, input-width, submit-button-align)
|
15
|
+
//
|
16
|
+
// Example:
|
17
|
+
//
|
18
|
+
// form.formtastic
|
19
|
+
// +stack-form(300px,"full","right")
|
20
|
+
//
|
21
|
+
// Default Settings:
|
22
|
+
//
|
23
|
+
!stacked_fieldset=100%
|
24
|
+
// Full width of the fieldset
|
25
|
+
//
|
26
|
+
!stacked_input="auto"
|
27
|
+
// "auto" = automatic widths
|
28
|
+
// "full" = same width as form
|
29
|
+
// "960px" = custom width
|
30
|
+
//
|
31
|
+
!stacked_padding=0
|
32
|
+
// Left padding on all labels and inputs
|
33
|
+
//
|
34
|
+
!stacked_button_align="buttons-left"
|
35
|
+
// "buttons-left" = float submit button left
|
36
|
+
// "buttons-right" = float submit button right
|
37
|
+
// "buttons-full" = submit button matches input width
|
38
|
+
//
|
39
|
+
!stacked_select_width = "select-auto"
|
40
|
+
// "select-auto" = default width
|
41
|
+
// "select-full" = same as specified input width
|
42
|
+
//
|
43
|
+
//--------------------------------------------------------
|
44
|
+
// FLOATED FORMS
|
45
|
+
// Column layout with labels left of the inputs
|
46
|
+
// Comes in 2 flavors for text alignment of the labels
|
47
|
+
//--------------------------------------------------------
|
48
|
+
//
|
49
|
+
// Arguments:
|
50
|
+
//
|
51
|
+
// +float-form-left(total-width, label-width, input-width, label-padding-x, submit-align)
|
52
|
+
//
|
53
|
+
// Examples:
|
54
|
+
//
|
55
|
+
// form.lefty
|
56
|
+
// +float-form-left(800px,500px,200px,6px,"buttons-left")
|
57
|
+
//
|
58
|
+
// form.righty
|
59
|
+
// +float-form-right(800px,500px,200px,6px,"buttons-left")
|
60
|
+
//
|
61
|
+
//--------------------------------------------------------
|
62
|
+
// Default Settings:
|
63
|
+
// (do not mix units because calculations are made)
|
64
|
+
//
|
65
|
+
!floated_total_width = 100%
|
66
|
+
// Total Width of form
|
67
|
+
//
|
68
|
+
!floated_input_width = 70%
|
69
|
+
// Width of inputs
|
70
|
+
//
|
71
|
+
!floated_label_width = 20%
|
72
|
+
// Width of Label
|
73
|
+
//
|
74
|
+
!floated_label_padding_x = 0
|
75
|
+
// How far labels are spaced from inputs
|
76
|
+
//
|
77
|
+
!floated_button_align = "buttons-left"
|
78
|
+
// "buttons-left" = float submit button left
|
79
|
+
// "buttons-right" = float submit button right
|
80
|
+
// "buttons-full" = submit button matches input width
|
81
|
+
//
|
82
|
+
!floated_label_text_align = "left"
|
83
|
+
// "left"
|
84
|
+
// "right"
|
85
|
+
// "center"
|
86
|
+
//
|
87
|
+
!floated_select_width = "select-auto"
|
88
|
+
// "select-auto" = default width
|
89
|
+
// "select-full" = same as specified input width
|
90
|
+
//
|
91
|
+
//========================================================
|
92
|
+
// FORMTASTIC STYLING
|
93
|
+
// Note: Be careful when modifying widths and
|
94
|
+
// horizontal padding/margins as you can break layouts
|
95
|
+
//========================================================
|
96
|
+
=clearfix
|
97
|
+
*display: inline-block
|
98
|
+
&:after
|
99
|
+
content: " "
|
100
|
+
display: block
|
101
|
+
height: 0
|
102
|
+
clear: both
|
103
|
+
visibility: hidden
|
104
|
+
//
|
105
|
+
//
|
106
|
+
//
|
107
|
+
//--------------------------------------------------------
|
108
|
+
//========================================================
|
109
|
+
// Base stuff (do not edit unless you are smarter than me :p)
|
110
|
+
//========================================================
|
111
|
+
//--------------------------------------------------------
|
112
|
+
//
|
113
|
+
//
|
114
|
+
//
|
115
|
+
//--------------------------------------------------------
|
116
|
+
// Generic Mixins
|
117
|
+
//--------------------------------------------------------
|
118
|
+
=float-labels(!width,!padding=0,!direction="left")
|
119
|
+
:width = !width - !padding
|
120
|
+
:text-align = !direction
|
121
|
+
:display inline
|
122
|
+
:float left
|
123
|
+
:clear none
|
124
|
+
@if !padding == 0
|
125
|
+
:padding 0
|
126
|
+
@else
|
127
|
+
:padding-#{!direction} = !padding
|
128
|
+
=block(!block_float="clear")
|
129
|
+
:display block
|
130
|
+
@if !block_float=="clear"
|
131
|
+
:clear both
|
132
|
+
:float none
|
133
|
+
@else
|
134
|
+
:float = !block_float
|
135
|
+
=inline(!float="none",!clear="none")
|
136
|
+
:display inline
|
137
|
+
:float = !float
|
138
|
+
:clear = !clear
|
139
|
+
=reset-form
|
140
|
+
// Reset elements
|
141
|
+
ul, ol, legend, p
|
142
|
+
:margin 0
|
143
|
+
:padding 0
|
144
|
+
li
|
145
|
+
:margin-left 0px
|
146
|
+
:margin-right 0px
|
147
|
+
:padding-left 0px
|
148
|
+
:padding-right 0px
|
149
|
+
// Clearfix fieldsets
|
150
|
+
fieldset
|
151
|
+
:display block
|
152
|
+
+clearfix
|
153
|
+
// * fields
|
154
|
+
abbr, acronym
|
155
|
+
:border 0
|
156
|
+
:font-variant normal
|
157
|
+
:font-weight normal
|
158
|
+
// Reset list styles
|
159
|
+
ol, ul
|
160
|
+
:list-style none
|
161
|
+
// Clearfix label
|
162
|
+
label
|
163
|
+
:display block
|
164
|
+
+clearfix
|
165
|
+
// Align Inputs
|
166
|
+
input, textarea
|
167
|
+
:vertical-align middle
|
168
|
+
// Make Labels Clickable
|
169
|
+
.check_boxes, .radio
|
170
|
+
input
|
171
|
+
:margin 0
|
172
|
+
label
|
173
|
+
:cursor pointer
|
174
|
+
// Hide hidden fields
|
175
|
+
.hidden
|
176
|
+
:display none
|
177
|
+
// Date Time Selects shown inline
|
178
|
+
.date, .time, .datetime
|
179
|
+
li
|
180
|
+
:float left
|
181
|
+
:width auto
|
182
|
+
:clear none
|
183
|
+
label
|
184
|
+
:display none
|
185
|
+
:width auto
|
186
|
+
input
|
187
|
+
:display inline
|
188
|
+
:margin 0
|
189
|
+
:padding 0
|
190
|
+
// Error lists for each input
|
191
|
+
.errors
|
192
|
+
:list-style square
|
193
|
+
li
|
194
|
+
:padding 0
|
195
|
+
:border none
|
196
|
+
:display list-item
|
197
|
+
:float none
|
198
|
+
:clear both
|
199
|
+
.inputs
|
200
|
+
:z-index 99
|
201
|
+
// Float Submit Buttons
|
202
|
+
.buttons li
|
203
|
+
:float left
|
204
|
+
// Reset Nested Fieldset & Legends
|
205
|
+
li
|
206
|
+
+clearfix
|
207
|
+
:display block
|
208
|
+
fieldset
|
209
|
+
:border none
|
210
|
+
:position relative
|
211
|
+
:margin-top 0px
|
212
|
+
legend
|
213
|
+
:display block
|
214
|
+
:margin-bottom 0
|
215
|
+
.label
|
216
|
+
:display block
|
217
|
+
:clear both
|
218
|
+
:background transparent
|
219
|
+
// Reset lists for checkboxes and radio buttons
|
220
|
+
ol
|
221
|
+
:float left
|
222
|
+
:margin 0
|
223
|
+
li
|
224
|
+
:padding 0
|
225
|
+
:border 0
|
226
|
+
:display inline
|
227
|
+
//
|
228
|
+
//--------------------------------------------------------
|
229
|
+
// Form Stack
|
230
|
+
//--------------------------------------------------------
|
231
|
+
//
|
232
|
+
=stack-form(!stacked_fieldset, !stacked_input, !stacked_padding, !stacked_button_align, !stacked_select_width)
|
233
|
+
+reset-form
|
234
|
+
fieldset
|
235
|
+
:width = !stacked_fieldset
|
236
|
+
ol
|
237
|
+
:padding-left = !stacked_padding
|
238
|
+
input
|
239
|
+
:clear both
|
240
|
+
:float none
|
241
|
+
li
|
242
|
+
+block
|
243
|
+
:width = !stacked_fieldset
|
244
|
+
ol
|
245
|
+
:padding 0
|
246
|
+
li
|
247
|
+
:clear none
|
248
|
+
:width auto
|
249
|
+
fieldset
|
250
|
+
legend, legend .label
|
251
|
+
:display block
|
252
|
+
:clear both
|
253
|
+
.label
|
254
|
+
:position relative
|
255
|
+
label, input
|
256
|
+
:width auto
|
257
|
+
.date, .time, .datetime
|
258
|
+
ol
|
259
|
+
:width = !stacked_fieldset
|
260
|
+
li
|
261
|
+
:display inline
|
262
|
+
:clear none
|
263
|
+
:float left
|
264
|
+
:padding-right = !stacked_padding / 2
|
265
|
+
.checkbox, .radio
|
266
|
+
li
|
267
|
+
:display block
|
268
|
+
input
|
269
|
+
:border none
|
270
|
+
label
|
271
|
+
+block
|
272
|
+
:width = !stacked_input
|
273
|
+
input, textarea
|
274
|
+
@if !stacked_input=="full"
|
275
|
+
:width = !stacked_fieldset - !stacked_padding
|
276
|
+
@else
|
277
|
+
:width = !stacked_input
|
278
|
+
select
|
279
|
+
@if !stacked_select_width == "select-auto"
|
280
|
+
:width auto
|
281
|
+
@else
|
282
|
+
:width = !stacked_input
|
283
|
+
.errors li
|
284
|
+
:display list-item
|
285
|
+
.buttons
|
286
|
+
ol
|
287
|
+
:padding-left = !stacked_padding
|
288
|
+
:padding-right = !stacked_padding
|
289
|
+
li
|
290
|
+
@if !stacked_button_align == "buttons-left"
|
291
|
+
:float left
|
292
|
+
@if !stacked_button_align == "buttons-right"
|
293
|
+
:float right
|
294
|
+
:width auto
|
295
|
+
:clear none
|
296
|
+
:display inline
|
297
|
+
input
|
298
|
+
@if !stacked_button_align == "buttons-full"
|
299
|
+
:width = !stacked_fieldset
|
300
|
+
@else
|
301
|
+
:width auto
|
302
|
+
#errorExplanation
|
303
|
+
:width = !stacked_fieldset - !stacked_padding
|
304
|
+
.label
|
305
|
+
// Legend Left Margin Hack for IE
|
306
|
+
:#left -0.5em
|
307
|
+
:#position relative
|
308
|
+
//
|
309
|
+
//--------------------------------------------------------
|
310
|
+
// Float Form Core
|
311
|
+
//--------------------------------------------------------
|
312
|
+
//
|
313
|
+
=float-form(!floated_total_width,!floated_label_width,!floated_input_width,!floated_label_padding_x, !floated_button_align, !floated_label_text_align, !floated_select_width )
|
314
|
+
+reset-form
|
315
|
+
fieldset
|
316
|
+
:width = !floated_total_width
|
317
|
+
label
|
318
|
+
:float left
|
319
|
+
:width = !floated_label_width - !floated_label_padding_x
|
320
|
+
:text-align = !floated_label_text_align
|
321
|
+
:padding-#{!floated_label_text_align} = !floated_label_padding_x
|
322
|
+
li
|
323
|
+
ol
|
324
|
+
:padding = 0 ( !floated_total_width - (!floated_input_width + !floated_label_width)) 0 !floated_label_width
|
325
|
+
fieldset
|
326
|
+
legend, legend .label
|
327
|
+
:display block
|
328
|
+
legend
|
329
|
+
+float-labels(!floated_label_width,!floated_label_padding_x,!floated_label_text_align)
|
330
|
+
:width = !floated_total_width - !floated_label_padding_x
|
331
|
+
.label
|
332
|
+
:position absolute
|
333
|
+
:width = !floated_label_width - !floated_label_padding_x
|
334
|
+
:top 0px
|
335
|
+
@if !floated_label_text_align=="right"
|
336
|
+
:left 0
|
337
|
+
@else
|
338
|
+
:left = !floated_label_padding_x
|
339
|
+
label
|
340
|
+
:padding-left 0
|
341
|
+
label, input
|
342
|
+
:width auto
|
343
|
+
:display inline
|
344
|
+
:clear none
|
345
|
+
:text-align left
|
346
|
+
select
|
347
|
+
:padding 0
|
348
|
+
:clear both
|
349
|
+
:display block
|
350
|
+
.inline-hints, .inline-errors, .errors
|
351
|
+
:margin = 0 0 0 !floated_label_width
|
352
|
+
input, textarea
|
353
|
+
:width = !floated_input_width
|
354
|
+
select
|
355
|
+
@if !floated_select_width=="select-auto"
|
356
|
+
:width auto
|
357
|
+
@else
|
358
|
+
:width = !floated_input_width
|
359
|
+
.checkbox, .radio
|
360
|
+
li
|
361
|
+
:display block
|
362
|
+
:clear both
|
363
|
+
input
|
364
|
+
:border none
|
365
|
+
.buttons
|
366
|
+
:padding-left = !floated_label_width
|
367
|
+
:width = !floated_total_width - !floated_label_width
|
368
|
+
input
|
369
|
+
:width auto
|
370
|
+
ol
|
371
|
+
@if !floated_button_align == "buttons-right"
|
372
|
+
:padding-right = !floated_label_padding_x
|
373
|
+
li
|
374
|
+
:width auto
|
375
|
+
@if !floated_button_align == "buttons-right"
|
376
|
+
:float right
|
377
|
+
@else
|
378
|
+
:float left
|
379
|
+
@if !floated_button_align == "full-buttons"
|
380
|
+
input
|
381
|
+
:width = !floated_input_width
|
382
|
+
@else
|
383
|
+
:display inline
|
384
|
+
#errorExplanation
|
385
|
+
:margin-left = !floated_label_width
|
386
|
+
:width = !floated_input_width
|
387
|
+
//
|
388
|
+
//--------------------------------------------------------
|
389
|
+
// Float Form Left/Right
|
390
|
+
//--------------------------------------------------------
|
391
|
+
//
|
392
|
+
=float-form-left(!floated_total_width,!floated_label_width,!floated_input_width,!floated_label_padding_x, !floated_button_align)
|
393
|
+
+float-form(!floated_total_width,!floated_label_width,!floated_input_width,!floated_label_padding_x, !floated_button_align,"left")
|
394
|
+
|
395
|
+
=float-form-right(!floated_total_width,!floated_label_width,!floated_input_width,!floated_label_padding_x, !floated_button_align)
|
396
|
+
+float-form(!floated_total_width,!floated_label_width,!floated_input_width,!floated_label_padding_x, !floated_button_align,"right")
|
397
|
+
|
398
|
+
//
|
399
|
+
//--------------------------------------------------------
|
400
|
+
// Float Inputs
|
401
|
+
//--------------------------------------------------------
|
402
|
+
//
|
403
|
+
=float-inputs(!margin_right=10px,!line_height=150%)
|
404
|
+
.radio, .check_boxes
|
405
|
+
ol
|
406
|
+
+inline("left")
|
407
|
+
li
|
408
|
+
:width auto
|
409
|
+
+inline("left","none")
|
410
|
+
input
|
411
|
+
:float none
|
412
|
+
:display inline
|
413
|
+
label
|
414
|
+
:display block
|
415
|
+
:clear none
|
416
|
+
:width auto
|
417
|
+
:padding-left 0
|
418
|
+
:line-height = !line_height
|
419
|
+
:margin-right = !margin_right
|
420
|
+
//
|
421
|
+
=float-inputs-for(!dom_target,!margin_right=10px,!line_height=150%)
|
422
|
+
#{!dom_target}
|
423
|
+
+float-inputs-core(!margin_right,!line_height)
|
424
|
+
//
|
425
|
+
//--------------------------------------------------------
|
426
|
+
// Grid Inputs
|
427
|
+
//--------------------------------------------------------
|
428
|
+
//
|
429
|
+
=grid-inputs(!width=100px,!line_height=150%)
|
430
|
+
.radio, .check_boxes
|
431
|
+
ol
|
432
|
+
+inline("left")
|
433
|
+
li
|
434
|
+
+inline("left","none")
|
435
|
+
:width = !width
|
436
|
+
label
|
437
|
+
+inline("left","none")
|
438
|
+
:width auto
|
439
|
+
:line-height = !line_height
|
440
|
+
|
441
|
+
=grid-inputs-for(!dom_target,!width=100px,!line_height=150%)
|
442
|
+
#{!dom_target}
|
443
|
+
+grid-inputs-core(!width,!line_height)
|
444
|
+
|
445
|
+
//--------------------------------------------------------
|
446
|
+
// Labels
|
447
|
+
//--------------------------------------------------------
|
448
|
+
=bold-labels(!select="all")
|
449
|
+
li
|
450
|
+
@if !select == "all"
|
451
|
+
label, legend span.label
|
452
|
+
:font-weight bold
|
453
|
+
li
|
454
|
+
label
|
455
|
+
:font-weight normal
|
456
|
+
@if !select == "required"
|
457
|
+
&.required
|
458
|
+
label, .label
|
459
|
+
:font-weight bold
|
460
|
+
li
|
461
|
+
label
|
462
|
+
:font-weight normal
|
463
|
+
|
464
|
+
|
465
|
+
//---------------------------------------------------
|
466
|
+
// Original Mixin (deprecated!)
|
467
|
+
//
|
468
|
+
!form_layout="float"
|
469
|
+
// Set the general layout of the form
|
470
|
+
// "float" will use two column layout with labels on the left
|
471
|
+
// "clear" will have labels above the inputs
|
472
|
+
|
473
|
+
//
|
474
|
+
!total_width=100%
|
475
|
+
// Set width of entire fieldset
|
476
|
+
//
|
477
|
+
// Set label widths and hint/error left margins
|
478
|
+
!label_width=24%
|
479
|
+
//
|
480
|
+
!input_width=70%
|
481
|
+
// Set width of inputs, textareas and selects
|
482
|
+
//
|
483
|
+
!label_pad=2%
|
484
|
+
// Set horizontal padding for labels
|
485
|
+
|
486
|
+
//
|
487
|
+
!label_float="left"
|
488
|
+
// Set alignment of labels
|
489
|
+
// "clear" puts labels above inputs
|
490
|
+
// "left" floats labels left and aligns text left
|
491
|
+
// "right" floats labels left and aligns text right
|
492
|
+
|
493
|
+
//
|
494
|
+
// Set widths of all inputs, textareas and selects (all aligned)
|
495
|
+
// False will preserve auto width
|
496
|
+
!full_width_inputs=true
|
497
|
+
//
|
498
|
+
// Set float direction of form buttons ("right" or "left")
|
499
|
+
!button_float="left"
|
500
|
+
// Installation ------------------------------------------
|
501
|
+
//
|
502
|
+
//$ sudo gem install haml
|
503
|
+
//$ cd rails app
|
504
|
+
//$ haml --rails (or merb/sinatra/etc)
|
505
|
+
//
|
506
|
+
// Set up master Sass file and include it in your html
|
507
|
+
// Save this file as _base.sass and include it in master sass like so:
|
508
|
+
//
|
509
|
+
// @import base.sass
|
510
|
+
//
|
511
|
+
// Usage -------------------------------------------------
|
512
|
+
//
|
513
|
+
// form.formtastic
|
514
|
+
// +formtastic-float
|
515
|
+
//
|
516
|
+
// This will provide forms of columns with label floated left
|
517
|
+
// For label on top of inputs you can use
|
518
|
+
//
|
519
|
+
// form.formtastic
|
520
|
+
// +formtastic-block
|
521
|
+
//
|
522
|
+
// Customize ---------------------------------------------
|
523
|
+
//
|
524
|
+
// form.formtastic
|
525
|
+
// +formtastic(410px,100px,300px,12px,"right",true)
|
526
|
+
//
|
527
|
+
// Note: When using pixel values be sure to pad total width by 10px
|
528
|
+
// Still looking for a way to make this cleaner
|
529
|
+
//--------------------------------------------------------
|
530
|
+
=formtastic(!total_width,!label_width,!input_width,!label_pad,!label_float,!button_float,!full_width_inputs)
|
531
|
+
fieldset
|
532
|
+
:width = !total_width
|
533
|
+
ol li
|
534
|
+
label
|
535
|
+
@if !label_float=="clear"
|
536
|
+
:display block
|
537
|
+
:clear both
|
538
|
+
:float none
|
539
|
+
@else
|
540
|
+
:float left
|
541
|
+
:width = !label_width - !label_pad
|
542
|
+
@if !label_float=="left"
|
543
|
+
:padding-left = !label_pad
|
544
|
+
:text-align left
|
545
|
+
@else
|
546
|
+
:text-align right
|
547
|
+
fieldset
|
548
|
+
legend
|
549
|
+
@if !label_float=="clear"
|
550
|
+
:display block
|
551
|
+
:clear both
|
552
|
+
:float none
|
553
|
+
span.label
|
554
|
+
:display block
|
555
|
+
:clear both
|
556
|
+
:float none
|
557
|
+
|
558
|
+
@else
|
559
|
+
:width = !label_width - !label_pad
|
560
|
+
@if !label_float=="left"
|
561
|
+
:padding-left = !label_pad
|
562
|
+
@else
|
563
|
+
:padding-right = !label_pad
|
564
|
+
:text-align right
|
565
|
+
span.label
|
566
|
+
:position absolute
|
567
|
+
:width = !label_width - !label_pad
|
568
|
+
ol
|
569
|
+
@if !label_float=="clear"
|
570
|
+
:padding 0
|
571
|
+
@else
|
572
|
+
:padding = 0 ( !total_width - (!input_width + !label_width)) 0 !label_width
|
573
|
+
@if !label_float == "clear"
|
574
|
+
&.string input, &.password input, &.numeric input, &.text textarea, select
|
575
|
+
:width = !input_width
|
576
|
+
@else
|
577
|
+
p.inline-hints, p.inline-errors, ul.errors
|
578
|
+
:margin = 0 0 0 !label_width
|
579
|
+
@if !full_width_inputs
|
580
|
+
&.string input, &.password input, &.numeric input, &.text textarea, select
|
581
|
+
:width = !input_width
|
582
|
+
&.boolean label
|
583
|
+
:padding-left = !label_width
|
584
|
+
fieldset
|
585
|
+
&.buttons
|
586
|
+
@if !label_float == "clear"
|
587
|
+
:width = !total_width
|
588
|
+
@else
|
589
|
+
:padding-left = !label_width
|
590
|
+
:width = !input_width
|
591
|
+
@if !button_float == "left"
|
592
|
+
ol
|
593
|
+
li
|
594
|
+
:display inline
|
595
|
+
:width auto
|
596
|
+
:float left
|
597
|
+
@if !button_float == "right"
|
598
|
+
ol
|
599
|
+
:padding-left 0
|
600
|
+
@if !label_float == "clear"
|
601
|
+
:width = !input_width
|
602
|
+
li
|
603
|
+
:float right
|
604
|
+
:width auto
|
605
|
+
@if !label_float != "clear"
|
606
|
+
:padding-left = !label_pad
|
607
|
+
//--------------------------------------------------------
|
608
|
+
// Formtastic Errors on top (aligned with label)
|
609
|
+
//
|
610
|
+
// Create formtastic.rb in config/initializers and add this:
|
611
|
+
// Formtastic::SemanticFormBuilder.inline_order = [:errors, :input, :hints]
|
612
|
+
// Best used with right-aligned labels
|
613
|
+
// +formtastic(100%,20%,70%,4%,"right")
|
614
|
+
//--------------------------------------------------------
|
615
|
+
=formtastic-errors-on-top(!label_vertical_margin=21px)
|
616
|
+
ol li.error
|
617
|
+
p.inline-errors
|
618
|
+
:margin-top 0px
|
619
|
+
label, span.label
|
620
|
+
:margin-top = "-#{!label_vertical_margin}"
|
621
|
+
:padding-bottom 18px
|
622
|
+
fieldset label
|
623
|
+
:margin-top 0
|
624
|
+
:padding-bottom 0
|