-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
510 lines (436 loc) · 22.5 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>CSS Formatter</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" sizes="16x16" href="img/icon16.png">
<link rel="icon" sizes="32x32" href="img/icon32.png">
<link rel="icon" sizes="60x60" href="img/icon60.png">
<link rel="icon" sizes="120x120" href="img/icon120.png">
<!-- styles -->
<link rel="stylesheet" href="css/styles.css">
<!-- scripts -->
<script type="text/javascript" src="js/libs/require.min.js"></script>
<script type="text/javascript" src="js/libs/angular.min.js"></script>
<script type="text/javascript" src="js/main.js"></script>
</head>
<body data-ng-controller="CSSFormatterCtrl">
<div class="content">
<div class="panel">
<h1>CSS Formatter</h1>
<!-- Intro Content -->
<div class="panel-content" data-show-mode="retina">
<div class="half-box">
<p>
This formatter gives some basic formatting options and provides a few extra formatting
customizations and options. It does not attempt to modify or optimize your styles.
</p>
<p>
By default, the formatter adds a table of contents to the formatted output and adds extra
indent to reflect the table.
</p>
</div>
<div class="half-box">
<p>
The table of contents is generated using selector level comments and the depth is determined
by the number of astericks at the beginning of the comment.
</p>
<p>
Single asterick comments are ignored.
</p>
</div>
<div class="full-box">
Add your CSS stylesheet to the input below to begin. If you need more info, each panel has its
own help button in the upper right corner.
</div>
</div>
</div>
<!-- Input Panel -->
<div class="panel panel-input">
<h2>Input</h2>
<a href="#" class="help-btn" data-popup-button="inputHelp">?</a>
<!-- Text Area -->
<div class="textarea">
<div class="parse-error-box" data-ng-class="{active:s.msg.parseError}">
{{s.msg.parseError}}
</div>
<textarea data-ng-model="s.input"></textarea>
</div>
<!-- Input Help -->
<div id="inputHelp" class="help-container" data-popup-box>
<div class="help-content">
<p>
The Input text area is where you paste the CSS stylesheet you want to format.
</p>
<p>
Once pasted, the output is automatically generated.
</p>
</div>
</div>
</div>
<!-- Output Panel -->
<div class="panel panel-output">
<h2>Output</h2>
<a href="#" class="help-btn" data-popup-button="outputHelp">?</a>
<!-- Format Select -->
<div class="select-box select-format" data-ng-model="s.format" data-show-mode="retina">
<div class="display">
<span class="title">Format</span>
<span class="value"></span>
</div>
<ul data-transition-height="select.isOpen">
<li data-value="expanded">Expanded</li>
<li data-value="compacted">Compacted</li>
<li data-value="nested">Nested</li>
<li data-value="compressed">Compressed</li>
</ul>
</div>
<!-- Advanced Settings Button -->
<a href="#" title="Advanced Settings" class="icon settings" data-toggle="showSettings"></a>
<!-- Advanced Settings-->
<div class="settings-box" data-transition-height="showSettings">
<div>
<!-- indent slider -->
<div class="slider-box" data-ng-model="css.indent"
data-enable="s.format !== 'compressed'"
data-min="0"
data-max="8"
data-step="1">
<div class="slider-box-edit-button">
<span class="value">
<span>{{css.indent | number:0}}</span><span class="unit-of-measure">sp</span>
</span>
<span class="title">
Indent
</span>
</div>
</div>
</div>
<h3>Comments</h3>
<div>
<!-- Include Comments Checkbox -->
<div class="checkbox" data-enable="s.format !== 'compressed'">
<input type="checkbox" id="include-comments"
data-ng-model="css.comments.render"
data-and="s.format !== 'compressed'">
<label for="include-comments">Include Comments</label>
</div>
<!-- Table of Contents Checkbox -->
<div class="checkbox" data-enable="css.comments.render">
<input type="checkbox" id="table-of-contents"
data-ng-model="css.tableOfContents"
data-and="css.comments.render">
<label for="table-of-contents">Table of Contents</label>
</div>
<!-- Include ToC Line Number Checkbox -->
<div class="checkbox" data-enable="css.tableOfContents && css.comments.render">
<input type="checkbox" id="toc-line-number"
data-ng-model="css.showLineNumbers"
data-and="css.tableOfContents && css.comments.render">
<label for="toc-line-number">ToC Line Numbers</label>
</div>
<!-- Add ToC Indent Checkbox -->
<div class="checkbox" data-enable="css.tableOfContents && css.comments.render && s.format !== 'compressed'">
<input type="checkbox" id="toc-indent"
data-ng-model="css.tocIndent"
data-and="css.tableOfContents && css.comments.render">
<label for="toc-indent">Add ToC Indent</label>
</div>
</div>
<h3>Selectors</h3>
<div>
<!-- Selector on New Line Checkbox -->
<div class="checkbox" data-enable="s.format !== 'compressed'">
<input type="checkbox" id="selectors-new-line" data-ng-model="css.selectors.newLine">
<label for="selectors-new-line">New Line</label>
</div>
<!-- Lines Before Slider -->
<div class="slider-box" data-ng-model="css.selectors.linesBefore"
data-enable="s.format !== 'compressed'"
data-max="8"
data-min="0"
data-step="1">
<div class="slider-box-edit-button">
<span class="value">
<span>{{css.selectors.linesBefore | number:0}}</span>
</span>
<span class="title">
Lines Before
</span>
</div>
</div>
<!-- Lines Before Comment Slider -->
<div class="slider-box" data-ng-model="css.selectors.linesBeforeComment"
data-enable="s.format !== 'compressed'"
data-max="8"
data-min="0"
data-step="1">
<div class="slider-box-edit-button">
<span class="value">
<span>{{css.selectors.linesBeforeComment | number:0}}</span>
</span>
<span class="title">
Lines Before Comment
</span>
</div>
</div>
</div>
<div>
<!-- Force Per Line Checkbox -->
<div class="checkbox" data-enable="s.format !== 'compressed'">
<input type="checkbox" id="selectors-force-line"
data-ng-model="css.selectors.forcePerLine">
<label for="selectors-force-line">1 Line per Selector</label>
</div>
<!-- Force Per Line Checkbox -->
<div class="checkbox" data-enable="s.format !== 'compressed' && !css.selectors.forcePerLine">
<input type="checkbox" id="selectors-force-combinated-line"
data-ng-model="css.selectors.combinatedPerLine">
<label for="selectors-force-combinated-line">1 Line per Combinated</label>
</div>
<!-- Max Length Textbox -->
<div class="textbox" data-enable="s.format !== 'compressed' && !css.selectors.forcePerLine">
<input type="text" id="selectors-max-length"
data-ng-model="css.selectors.maxLength">
<label for="selectors-max-length">
<span class="value">
<span>{{css.selectors.maxLength | number:0}}</span><span class="unit-of-measure">ch</span>
</span>
<span class="title">
Max Length
</span>
</label>
</div>
</div>
<h3>Braces</h3>
<div>
<!-- Open Brace on New Line Checkbox -->
<div class="checkbox" data-enable="s.format !== 'compressed'">
<input type="checkbox" id="braces-open-new-line"
data-ng-model="css.braces.openNewLine">
<label for="braces-open-new-line">Open Brace New Line</label>
</div>
<!-- Open Brace Indent Slider -->
<div class="slider-box" data-ng-model="css.braces.openIndent"
data-enable="s.format !== 'compressed'"
data-min="0"
data-max="8"
data-step="1">
<div class="slider-box-edit-button">
<span class="value">
<span>{{css.braces.openIndent | number:0}}</span><span class="unit-of-measure">sp</span>
</span>
<span class="title">
Open Brace Indent
</span>
</div>
</div>
</div>
<div>
<!-- Close Brace on New Line Checkbox -->
<div class="checkbox" data-enable="s.format !== 'compressed'">
<input type="checkbox" id="braces-close-new-line"
data-ng-model="css.braces.closeNewLine">
<label for="braces-close-new-line">Close Brace New Line</label>
</div>
<!-- Close Brace Indent Slider -->
<div class="slider-box" data-ng-model="css.braces.closeIndent"
data-enable="s.format !== 'compressed'"
data-max="8"
data-min="0"
data-step="1">
<div class="slider-box-edit-button">
<span class="value">
<span>{{css.braces.closeIndent | number:0}}</span><span class="unit-of-measure">sp</span>
</span>
<span class="title">
Close Brace Indent
</span>
</div>
</div>
</div>
</div>
<!-- Output Stylesheet -->
<div class="stylesheet-container">
<!-- Stylesheet Header -->
<div class="stylesheet-header">
<a href="#" class="icon copy" title="Copy Stylesheet to Clipboard"
data-copy-btn="stylesheet"
data-on-success="confirmCopy(true)"
data-on-fail="confirmCopy(false)"></a>
<span class="copy-confirm copy-success hidden"
data-ng-class="{'hidden':!s.msg.copy || !s.msg.copy.isSuccess, 'priority': !s.msg.copy || s.msg.copy.isSuccess}">Stylesheet copied to your clipboard.</span>
<span class="copy-confirm copy-error hidden"
data-ng-class="{'hidden':!s.msg.copy || s.msg.copy.isSuccess, 'priority': !s.msg.copy || !s.msg.copy.isSuccess}">Unable to copy stylesheet to your clipboard. Try manual copy.</span>
</div>
<!-- Stylesheet -->
<div class="stylesheet" id="stylesheet" data-css-lines="s.output"></div>
</div>
<!-- Output Help -->
<div id="outputHelp" class="help-container" data-popup-box>
<h3>Output Controls</h3>
<div class="help-content">
<ul>
<li>
<span class="term">Format</span>
<span class="def">
There are three basic formats to choose from: Expanded, Compacted and Compressed. You
can edit settings for all except the Compressed format. Some settings are reset when
changing the format.
</span>
</li>
<li>
<span class="term">Indent</span>
<span class="def">
The number of spaces per indent unit. The default is 4 spaces.
</span>
</li>
</ul>
</div>
<h3>Comments</h3>
<div class="help-content">
<ul>
<li>
<div class="term">Include Comments</div>
<div class="def">
When enabled, the output will include comments. This must be enabled in order to use
Table of Contents.
</div>
</li>
<li>
<div class="term">Table of Contents</div>
<div class="def">
<p>
When enabled, a table of contents comment is generated and included at the
beginning of the output.
</p>
<p>
The table entries are take from selector level comments that start with more than
1 astericks. The depth of the entry is determined by the number of astericks.
The more astericks, the less depth. The comments with the most astericks become
the root depth and the comments with the least astericks become the deapest depth.
</p>
<p>
The specific number of astericks used is unimportant as the entry depth is
determined by the relative difference of the number of astericks in the available
comments.
</p>
</div>
</li>
<li>
<div class="term">ToC Line Numbers</div>
<div class="def">
When enabled, the line number for Table of Contents entries are included.
</div>
</li>
<li>
<div class="term">Add ToC Indent</div>
<div class="def">
When enabled, additional indent is added to the styles to represent the depth of their
entry in the Table of Contents.
</div>
</li>
</ul>
</div>
<h3>Selectors</h3>
<div class="help-content">
<ul>
<li>
<div class="term">New Line</div>
<div class="def">
When enabled, selectors always start on a new line.
</div>
</li>
<li>
<div class="term">Lines Before</div>
<div class="def">
The number of extra lines to add before selectors.
</div>
</li>
<li>
<div class="term">Lines Before Comment</div>
<div class="def">
The number of extra lines to add before selectors that are after a comment. The actual
value is determined by whichever value is bigger: Lines Before and Close Before
Comment.
</div>
</li>
<li>
<div class="term">1 Line per Selector</div>
<div class="def">
When enabled, each selector in a multi-selector is on it's own line.
</div>
</li>
<li>
<div class="term">1 Line per Combinated</div>
<div class="def">
When enabled, each selector in multi-selector that has at least 1 combinator
(+, >, space, etc) is on it's own line. This option is disabled if all selectors in
a multi-selectors are on their own line.
</div>
</li>
<li>
<div class="term">Max Length</div>
<div class="def">
In a multi-selector, this is the max number of characters in a line before forcing the
next line. Single selectors that exceed this value are never wrapped. This option is
disabled if all selectors in multi-selectors are on their own line.
</div>
</li>
</ul>
</div>
<h3>Braces</h3>
<div class="help-content">
<ul>
<li>
<div class="term">Open Brace New Line</div>
<div class="def">
When enabled, selector opening braces are placed on a new line.
</div>
</li>
<li>
<div class="term">Open Brace Indent</div>
<div class="def">
The number of spaces to include before an opening brace. If the brace is on a new
line, this is in addition to the normal indent.
</div>
</li>
<li>
<div class="term">Close Brace New Line</div>
<div class="def">
When enabled, selector closing braces are placed on a new line.
</div>
</li>
<li>
<div class="term">Open Brace Indent</div>
<div class="def">
The number of spaces to include before a closing brace. If the brace is on a new
line, this is in addition to the normal indent.
</div>
</li>
</ul>
</div>
<h3>Copy to Clipboard</h3>
<div class="help-content">
<p>
You can copy the stylesheet to your clipboard easily by pressing the button located just
above the generated stylesheet. If your browser does not support copy operations, you can
still manually copy the text by right-clicking the selected text and choose 'Copy'.
</p>
</div>
</div>
</div>
</div>
<!-- Footer -->
<div class="footer">
<div>
Retina CSS Sprite Generator by <a href="https://twitter.com/JCThePants" target="_blank">JCThePants</a>.
</div>
<div>
Icons by <a href="https://www.iconfinder.com/designmodo" target="_blank">Designmodo</a>.
</div>
<a href="https://github.com/JCThePants/CSS-Formatter" class="icon github" target="_blank"></a>
</div>
</body>
</html>