1
1
# com-css-sort #
2
2
3
- com-css-sort stands for Common CSS Sorting. The goal of this project
3
+ com-css-sort stands for Common CSS Sorting. The goal of this project
4
4
is to provide a basic way of sorting CSS attributes.<br /><br />
5
5
6
6
7
7
## How to use? ##
8
8
9
9
### Alphabetic Order ###
10
- 1 . Just set ` com-css-sort-sort-type ` to 1.
10
+ 1 . Just set ` com-css-sort-sort-type ` to 1.
11
11
12
12
### Customize Order Your Own ###
13
- 1 . Create ` sort-order.ccs ` file at the version control root directory.
14
- You can grab a ccs file from ` ./ccs_examples/ ` directory in this repository.
15
- 2 . Look at the .ccs file, the order in the file will be the order that
13
+ 1 . Create ` sort-order.ccs ` file at the version control root directory.
14
+ You can grab a ccs file from ` ./ccs_examples/ ` directory in this repository.
15
+ 2 . Look at the .ccs file, the order in the file will be the order that
16
16
the CSS attributes will be sorted.
17
17
18
18
19
19
## Configuration ##
20
20
Type of sorting algorithm you want used when sorting CSS attributes.<br />
21
- * 0 : Sort in group type. Use 'sort-order.ccs' if
21
+ * 0 : Sort in group type. Use 'sort-order.ccs' if
22
22
there is one in the version control root directory. (Default)<br />
23
- * 1 : Sort in alphabetic order. The 'sort-order.ccs'
23
+ * 1 : Sort in alphabetic order. The 'sort-order.ccs'
24
24
file will be ignore and will not do anything.<br />
25
25
```
26
26
(setq com-css-sort-sort-type 0)
27
27
```
28
28
29
- If you don't like the path or file name, you can change it too. This variable is
29
+ If you don't like the path or file name, you can change it too. This variable is
30
30
relative path to version control root directory.
31
31
```
32
32
(setq com-css-sort-sort-file "sort-order.ccs")
33
33
```
34
34
35
- Customize your own sorting order programmatically. If you do not have the
35
+ Customize your own sorting order programmatically. If you do not have the
36
36
`sort-order.ccs' file in the version control root directory then this will be use!
37
37
```
38
- (setq com-css-sort-default-attributes-order '("display" "position" "top" "right" "bottom" "left" "float" "clear"
38
+ (setq com-css-sort-default-attributes-order '("display" "position" "top" "right" "bottom" "left" "float" "clear"
39
39
"visibility" "opacity" "z-index" "margin" "margin-top" "margin-right" "margin-bottom" "margin-left" "outline"
40
- "border" "border-top" "border-right" "border-bottom" "border-left" "border-width" "border-top-width"
41
- "border-right-width" "border-bottom-width" "border-left-width" "border-style" "border-top-style"
42
- "border-right-style" "border-bottom-style" "border-left-style" "border-color" "border-top-color"
43
- "border-right-color" "border-bottom-color" "border-left-color" "background" "background-color" "background-image"
44
- "background-repeat" "background-position" "cursor" "padding" "padding-top" "padding-right" "padding-bottom"
45
- "padding-left" "width" "min-width" "max-width" "height" "min-height" "max-height" "overflow" "list-style"
46
- "caption-side" "table-layout" "border-collapse" "border-spacing" "empty-cells" "vertical-align" "text-align"
47
- "text-indent" "text-transform" "text-decoration" "line-height" "word-spacing" "letter-spacing" "white-space"
40
+ "border" "border-top" "border-right" "border-bottom" "border-left" "border-width" "border-top-width"
41
+ "border-right-width" "border-bottom-width" "border-left-width" "border-style" "border-top-style"
42
+ "border-right-style" "border-bottom-style" "border-left-style" "border-color" "border-top-color"
43
+ "border-right-color" "border-bottom-color" "border-left-color" "background" "background-color" "background-image"
44
+ "background-repeat" "background-position" "cursor" "padding" "padding-top" "padding-right" "padding-bottom"
45
+ "padding-left" "width" "min-width" "max-width" "height" "min-height" "max-height" "overflow" "list-style"
46
+ "caption-side" "table-layout" "border-collapse" "border-spacing" "empty-cells" "vertical-align" "text-align"
47
+ "text-indent" "text-transform" "text-decoration" "line-height" "word-spacing" "letter-spacing" "white-space"
48
48
"color" "font" "font-family" "font-size" "font-weight" "content" "quotes"))
49
49
```
50
50
@@ -53,14 +53,19 @@ Customize your own sorting order programmatically. If you do not have the
53
53
Just bind the key if to whatever you feel comfortable with.
54
54
```
55
55
;; Sort attributes inside block.
56
- (define-key css-mode-map "\C-ks" 'com-css-sort-attributes-block)
56
+ (define-key css-mode-map (kbd "C-k s") # 'com-css-sort-attributes-block)
57
57
58
58
;; Sort attributes through the whole document.
59
- (define-key css-mode-map "\C-kd" 'com-css-sort-attributes-document)
59
+ (define-key css-mode-map (kbd "C-k d") # 'com-css-sort-attributes-document)
60
60
```
61
61
62
62
## Screen Shot ##
63
- <img src =" ./screen_shot/com_css_sort_demo1.gif " />
63
+ Before Sotring
64
+ <img src =" ./screenshot/com-css-sort-before.png " />
65
+ Type Sorting
66
+ <img src =" ./screenshot/com-css-sort-type-sort.png " />
67
+ Alphabetic Sorting
68
+ <img src =" ./screenshot/com-css-sort-alphabetic-sort.png " />
64
69
65
70
66
71
## Contribution ##
0 commit comments