├── .editorconfig
├── .gitignore
├── .npmrc
├── LICENSE.md
├── README.md
├── keymaps
└── postcss-sorting.cson
├── lib
├── postcss-sorting.coffee
└── presets
│ ├── csscomb.json
│ ├── default.json
│ ├── smacss.json
│ ├── yandex.json
│ └── zen.json
├── menus
└── postcss-sorting.cson
└── package.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | charset = utf-8
5 | end_of_line = lf
6 | insert_final_newline = true
7 |
8 | [*.{coffee, cson}]
9 | indent_style = space
10 | indent_size = 2
11 | trim_trailing_whitespace = true
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | npm-debug.log
3 | node_modules
4 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | save-exact=true
2 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | Copyright (c) 2015-2016 Emil Kashkevich
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining
4 | a copy of this software and associated documentation files (the
5 | "Software"), to deal in the Software without restriction, including
6 | without limitation the rights to use, copy, modify, merge, publish,
7 | distribute, sublicense, and/or sell copies of the Software, and to
8 | permit persons to whom the Software is furnished to do so, subject to
9 | the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be
12 | included in all copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # atom-postcss-sorting
2 | []()
3 | [](https://atom.io/packages/postcss-sorting)
4 |
5 | 
6 |
7 | Atom editor plugin to sort CSS rules content with specified order. The following syntaxes are currently supported: CSS, SASS/SCSS and PostCSS (aka SugarSS).
8 |
9 | ## Installation
10 |
11 | ```
12 | $ apm install postcss-sorting
13 | ```
14 | or open Atom and go to Preferences > Install and search for `postcss-sorting` package.
15 |
16 | ## Options
17 |
18 | You can select one of the bundled presets: _default_, _csscomb_, _yandex_ and _zen_.
19 |
20 | If any of the following config files exist, they will override the selected preset. They are loaded in the following order of priority:
21 |
22 | 1. `.postcss-sorting.json` or `postcss-sorting.json` at the root of your project
23 |
24 | 2. A `"postcssSortingConfig": { ... }` object in your project `package.json`
25 |
26 | 3. Custom `~/path/to/your/config.json` (if specified in package settings)
27 |
28 | 4. `~/.postcss-sorting.json` or `~/postcss-sorting.json` file in your `HOME` directory
29 |
30 | Files can be processed "On Save" (not enabled by default).
31 |
32 | "On Save" can be disabled if no config file is present (not enabled by default).
33 |
34 | Notifications can also be disabled from the package settings.
35 |
36 | ## Usage
37 |
38 | In a CSS or PostCSS file, open the Command Palette (Cmd + Shift + P (OS X), Ctrl + Shift + P (Windows/Linux)) and choose `PostCSS Sorting: Run`.
39 |
40 | Keyboard shortcut: Ctrl + Shift + S
41 |
42 | If you have an "On Save" option enabled and "Check for config file" option disabled just save a file.
43 |
44 | ## Acknowledgements
45 |
46 | This plugin is based on the [postcss-sorting](https://github.com/hudochenkov/postcss-sorting) plugin by [Aleks Hudochenkov](https://github.com/hudochenkov)
47 |
--------------------------------------------------------------------------------
/keymaps/postcss-sorting.cson:
--------------------------------------------------------------------------------
1 | 'atom-text-editor':
2 | 'ctrl-shift-s': 'postcss-sorting:run'
3 |
--------------------------------------------------------------------------------
/lib/postcss-sorting.coffee:
--------------------------------------------------------------------------------
1 | fs = require 'fs'
2 | {resolve} = require 'path'
3 | postcss = null
4 | sorting = null
5 | syntax = null
6 |
7 | module.exports =
8 | config:
9 | customConfig:
10 | description: 'Custom path to config file.'
11 | type: 'string'
12 | default: ''
13 | order: 1
14 | preset:
15 | description: 'Fallback to this preset in the absence of a config file.'
16 | type: 'string'
17 | default: 'default'
18 | enum: ['default', 'zen', 'csscomb', 'yandex', 'smacss']
19 | order: 2
20 | notify:
21 | description: 'Display notification on successful sort.'
22 | type: 'boolean'
23 | default: true
24 | order: 3
25 | shouldUpdateOnSave:
26 | title: 'On Save'
27 | description: 'Process file on every save.'
28 | type: 'boolean'
29 | default: false
30 | order: 4
31 | checkForConfigFile:
32 | title: 'Check for config file to enable On Save processing'
33 | description: "You can enable On Save globally or only if the config file exists.\n\n
34 | This still requires On Save option to be enabled."
35 | type: 'boolean'
36 | default: false
37 | order: 5
38 |
39 | _allowedGrammars: ['css', 'scss', 'postcss']
40 | _editorObserver: null
41 | _subs: null
42 |
43 | activate: ->
44 | @_subs = atom.commands.add 'atom-text-editor', 'postcss-sorting:run', =>
45 | @_sort atom.workspace.getActivePaneItem()
46 | @_editorObserver = atom.workspace.observeTextEditors (editor) =>
47 | @_handleEvents editor
48 |
49 | _handleEvents: (editor) ->
50 | editor.getBuffer().onWillSave =>
51 | if @_isOnSave() and @_isAllowedGramar(editor)
52 | @_sort atom.workspace.getActivePaneItem()
53 |
54 | _getOptionsPaths: ->
55 | @_config ?= atom.config.get 'postcss-sorting'
56 | HOME = process.env.HOME
57 | optionsPaths = [
58 | '.postcss-sorting.json',
59 | 'postcss-sorting.json',
60 | 'package.json'
61 | ]
62 |
63 | if @_config.customConfig
64 | optionsPaths.push @_config.customConfig.replace(/^~/, HOME)
65 |
66 | optionsPaths.push "#{HOME}/.postcss-sorting.json", "#{HOME}/postcss-sorting.json"
67 |
68 | optionsPaths
69 |
70 | _getPredefinedConfig: ->
71 | @_config ?= atom.config.get 'postcss-sorting'
72 | pluginPath = atom.packages.resolvePackagePath 'postcss-sorting'
73 | predefinedConfigPath = "#{pluginPath}/lib/presets/#{@_config.preset}.json"
74 | predefinedConfig = null
75 |
76 | if fs.existsSync predefinedConfigPath
77 | predefinedConfig = JSON.parse(fs.readFileSync(predefinedConfigPath))
78 |
79 | predefinedConfig
80 |
81 | _customConfigExist: ->
82 | @_config ?= atom.config.get 'postcss-sorting'
83 | {path} = atom.project.getDirectories()[0]
84 | optionsPaths = @_getOptionsPaths()
85 | configExist = false
86 |
87 | for optionsPath in optionsPaths
88 | optionsPath = resolve(path, optionsPath)
89 |
90 | if fs.existsSync optionsPath
91 | if optionsPath.endsWith('package.json')
92 | options = JSON.parse(fs.readFileSync(optionsPath))
93 | if options.postcssSortingConfig
94 | configExist = true
95 | else
96 | configExist = true
97 | break
98 |
99 | configExist
100 |
101 | _isOnSave: ->
102 | @_config ?= atom.config.get 'postcss-sorting'
103 |
104 | if @_config.checkForConfigFile
105 | @_config.shouldUpdateOnSave && @_customConfigExist()
106 | else
107 | @_config.shouldUpdateOnSave
108 |
109 | _isAllowedGramar: (editor) ->
110 | currentGrammar = editor.getGrammar().name.toLowerCase()
111 | @_allowedGrammars.includes currentGrammar
112 |
113 | _sort: (editor) ->
114 | postcss ?= require 'postcss'
115 | sorting ?= require 'postcss-sorting'
116 | @_config ?= atom.config.get 'postcss-sorting'
117 | preset = @_config.preset
118 | {path} = atom.project.getDirectories()[0]
119 | selection = editor.getSelectedText()
120 | buffer = editor.getBuffer()
121 | grammar = editor.getGrammar()
122 | predefinedConfig = @_getPredefinedConfig()
123 | options = null
124 |
125 | if grammar.scopeName == 'source.css.postcss.sugarss'
126 | syntax = require 'sugarss'
127 | else
128 | syntax = require 'postcss-scss'
129 |
130 | src =
131 | content: if selection.length then selection else buffer.getText()
132 | isSelection: selection.length > 0
133 |
134 | optionsPaths = @_getOptionsPaths()
135 |
136 | for optionsPath in optionsPaths
137 | optionsPath = resolve(path, optionsPath)
138 |
139 | if fs.existsSync optionsPath
140 | try
141 | options = JSON.parse(fs.readFileSync(optionsPath))
142 | if optionsPath.endsWith('package.json')
143 | options = options.postcssSortingConfig ? null
144 | throw {} unless options
145 | break
146 |
147 | postcss([ sorting (options || predefinedConfig) ])
148 | .process(src.content, { syntax: syntax })
149 | .then (result) =>
150 | shouldUpdateContent = src.content != result.css
151 |
152 | return if !shouldUpdateContent
153 |
154 | cursorPosition = editor.getCursorScreenPosition()
155 |
156 | if src.isSelection
157 | editor.insertText(result.css)
158 | else
159 | editor.setText(result.css)
160 |
161 | editor.setCursorScreenPosition(cursorPosition)
162 |
163 | if @_config.notify
164 | usedPreset = if options then "custom '#{optionsPath}' file." else "'#{preset}' preset."
165 | atom.notifications?.addSuccess("Successfully sorted using #{usedPreset}")
166 |
167 | .catch (error) ->
168 | message = "Sorting error: '#{error.reason}'."
169 | atom.notifications?.addError(message, {detail: error.message})
170 |
171 | deactivate: ->
172 | @_subs.dispose()
173 | @_editorObserver.dispose()
174 |
--------------------------------------------------------------------------------
/lib/presets/csscomb.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties-order": [
3 | {
4 | "emptyLineBefore": true,
5 | "properties": [
6 | "font",
7 | "font-family",
8 | "font-size",
9 | "font-weight",
10 | "font-style",
11 | "font-variant",
12 | "font-size-adjust",
13 | "font-stretch",
14 | "font-effect",
15 | "font-emphasize",
16 | "font-emphasize-position",
17 | "font-emphasize-style",
18 | "font-smooth",
19 | "line-height"
20 | ]
21 | },
22 | {
23 | "emptyLineBefore": true,
24 | "properties": [
25 | "position",
26 | "z-index",
27 | "top",
28 | "right",
29 | "bottom",
30 | "left"
31 | ]
32 | },
33 | {
34 | "emptyLineBefore": true,
35 | "properties": [
36 | "display",
37 | "visibility",
38 | "float",
39 | "clear",
40 | "overflow",
41 | "overflow-x",
42 | "overflow-y",
43 | "clip",
44 | "zoom",
45 | "flex-direction",
46 | "flex-order",
47 | "flex-pack",
48 | "flex-align"
49 | ]
50 | },
51 | {
52 | "emptyLineBefore": true,
53 | "properties": [
54 | "box-sizing",
55 | "width",
56 | "min-width",
57 | "max-width",
58 | "height",
59 | "min-height",
60 | "max-height",
61 | "margin",
62 | "margin-top",
63 | "margin-right",
64 | "margin-bottom",
65 | "margin-left",
66 | "padding",
67 | "padding-top",
68 | "padding-right",
69 | "padding-bottom",
70 | "padding-left"
71 | ]
72 | },
73 | {
74 | "emptyLineBefore": true,
75 | "properties": [
76 | "table-layout",
77 | "empty-cells",
78 | "caption-side",
79 | "border-spacing",
80 | "border-collapse",
81 | "list-style",
82 | "list-style-position",
83 | "list-style-type",
84 | "list-style-image"
85 | ]
86 | },
87 | {
88 | "emptyLineBefore": true,
89 | "properties": [
90 | "content",
91 | "quotes",
92 | "counter-reset",
93 | "counter-increment",
94 | "resize",
95 | "cursor",
96 | "user-select",
97 | "nav-index",
98 | "nav-up",
99 | "nav-right",
100 | "nav-down",
101 | "nav-left",
102 | "transition",
103 | "transition-delay",
104 | "transition-timing-function",
105 | "transition-duration",
106 | "transition-property",
107 | "transform",
108 | "transform-origin",
109 | "animation",
110 | "animation-name",
111 | "animation-duration",
112 | "animation-play-state",
113 | "animation-timing-function",
114 | "animation-delay",
115 | "animation-iteration-count",
116 | "animation-direction",
117 | "text-align",
118 | "text-align-last",
119 | "vertical-align",
120 | "white-space",
121 | "text-decoration",
122 | "text-emphasis",
123 | "text-emphasis-color",
124 | "text-emphasis-style",
125 | "text-emphasis-position",
126 | "text-indent",
127 | "text-justify",
128 | "letter-spacing",
129 | "word-spacing",
130 | "writing-mode",
131 | "text-outline",
132 | "text-transform",
133 | "text-wrap",
134 | "text-overflow",
135 | "text-overflow-ellipsis",
136 | "text-overflow-mode",
137 | "word-wrap",
138 | "word-break",
139 | "tab-size",
140 | "hyphens",
141 | "pointer-events"
142 | ]
143 | },
144 | {
145 | "emptyLineBefore": true,
146 | "properties": [
147 | "opacity",
148 | "filter",
149 | "interpolation-mode",
150 | "color",
151 | "border",
152 | "border-width",
153 | "border-style",
154 | "border-color",
155 | "border-top",
156 | "border-top-width",
157 | "border-top-style",
158 | "border-top-color",
159 | "border-right",
160 | "border-right-width",
161 | "border-right-style",
162 | "border-right-color",
163 | "border-bottom",
164 | "border-bottom-width",
165 | "border-bottom-style",
166 | "border-bottom-color",
167 | "border-left",
168 | "border-left-width",
169 | "border-left-style",
170 | "border-left-color",
171 | "border-radius",
172 | "border-top-left-radius",
173 | "border-top-right-radius",
174 | "border-bottom-right-radius",
175 | "border-bottom-left-radius",
176 | "border-image",
177 | "border-image-source",
178 | "border-image-slice",
179 | "border-image-width",
180 | "border-image-outset",
181 | "border-image-repeat",
182 | "outline",
183 | "outline-width",
184 | "outline-style",
185 | "outline-color",
186 | "outline-offset",
187 | "background",
188 | "background-color",
189 | "background-image",
190 | "background-repeat",
191 | "background-attachment",
192 | "background-position",
193 | "background-position-x",
194 | "background-position-y",
195 | "background-clip",
196 | "background-origin",
197 | "background-size",
198 | "box-decoration-break",
199 | "box-shadow",
200 | "text-shadow"
201 | ]
202 | }
203 | ]
204 | }
205 |
--------------------------------------------------------------------------------
/lib/presets/default.json:
--------------------------------------------------------------------------------
1 | {
2 | "order": [
3 | "custom-properties",
4 | "dollar-variables",
5 | "at-rules",
6 | "declarations",
7 | {
8 | "type": "at-rule",
9 | "name": "media"
10 | },
11 | "rules"
12 | ],
13 | "properties-order": [
14 | "lost-utility",
15 | "lost-flex-container",
16 | "lost-center",
17 | "lost-align",
18 | "lost-column",
19 | "lost-row",
20 | "lost-waffle",
21 | "lost-offset",
22 | "lost-move",
23 | "lost-masonry-wrap",
24 | "lost-masonry-column",
25 | "position",
26 | "top",
27 | "right",
28 | "bottom",
29 | "left",
30 | "z-index",
31 | "display",
32 | "visibility",
33 | "flex",
34 | "flex-grow",
35 | "flex-shrink",
36 | "flex-basis",
37 | "flex-direction",
38 | "flex-flow",
39 | "flex-wrap",
40 | "align-content",
41 | "align-items",
42 | "align-self",
43 | "justify-content",
44 | "order",
45 | "float",
46 | "clear",
47 | "overflow",
48 | "overflow-x",
49 | "overflow-y",
50 | "overflow-scrolling",
51 | "clip",
52 | "box-sizing",
53 | "margin",
54 | "margin-top",
55 | "margin-right",
56 | "margin-bottom",
57 | "margin-left",
58 | "padding",
59 | "padding-top",
60 | "padding-right",
61 | "padding-bottom",
62 | "padding-left",
63 | "min-width",
64 | "min-height",
65 | "max-width",
66 | "max-height",
67 | "width",
68 | "height",
69 | "outline",
70 | "outline-width",
71 | "outline-style",
72 | "outline-color",
73 | "outline-offset",
74 | "border",
75 | "border-spacing",
76 | "border-collapse",
77 | "border-width",
78 | "border-style",
79 | "border-color",
80 | "border-top",
81 | "border-top-width",
82 | "border-top-style",
83 | "border-top-color",
84 | "border-right",
85 | "border-right-width",
86 | "border-right-style",
87 | "border-right-color",
88 | "border-bottom",
89 | "border-bottom-width",
90 | "border-bottom-style",
91 | "border-bottom-color",
92 | "border-left",
93 | "border-left-width",
94 | "border-left-style",
95 | "border-left-color",
96 | "border-radius",
97 | "border-top-left-radius",
98 | "border-top-right-radius",
99 | "border-bottom-right-radius",
100 | "border-bottom-left-radius",
101 | "border-image",
102 | "border-image-source",
103 | "border-image-slice",
104 | "border-image-width",
105 | "border-image-outset",
106 | "border-image-repeat",
107 | "border-top-image",
108 | "border-right-image",
109 | "border-bottom-image",
110 | "border-left-image",
111 | "border-corner-image",
112 | "border-top-left-image",
113 | "border-top-right-image",
114 | "border-bottom-right-image",
115 | "border-bottom-left-image",
116 | "background",
117 | "background-color",
118 | "background-image",
119 | "background-attachment",
120 | "background-position",
121 | "background-position-x",
122 | "background-position-y",
123 | "background-clip",
124 | "background-origin",
125 | "background-size",
126 | "background-repeat",
127 | "box-decoration-break",
128 | "box-shadow",
129 | "color",
130 | "table-layout",
131 | "caption-side",
132 | "empty-cells",
133 | "list-style",
134 | "list-style-position",
135 | "list-style-type",
136 | "list-style-image",
137 | "quotes",
138 | "content",
139 | "counter-increment",
140 | "counter-reset",
141 | "writing-mode",
142 | "vertical-align",
143 | "text-align",
144 | "text-align-last",
145 | "text-decoration",
146 | "text-emphasis",
147 | "text-emphasis-position",
148 | "text-emphasis-style",
149 | "text-emphasis-color",
150 | "text-indent",
151 | "text-justify",
152 | "text-outline",
153 | "text-transform",
154 | "text-wrap",
155 | "text-overflow",
156 | "text-overflow-ellipsis",
157 | "text-overflow-mode",
158 | "text-shadow",
159 | "white-space",
160 | "word-spacing",
161 | "word-wrap",
162 | "word-break",
163 | "tab-size",
164 | "hyphens",
165 | "letter-spacing",
166 | "font",
167 | "font-weight",
168 | "font-style",
169 | "font-variant",
170 | "font-size-adjust",
171 | "font-stretch",
172 | "font-size",
173 | "font-family",
174 | "src",
175 | "line-height",
176 | "opacity",
177 | "interpolation-mode",
178 | "filter",
179 | "resize",
180 | "cursor",
181 | "nav-index",
182 | "nav-up",
183 | "nav-right",
184 | "nav-down",
185 | "nav-left",
186 | "transition",
187 | "transition-delay",
188 | "transition-timing-function",
189 | "transition-duration",
190 | "transition-property",
191 | "transform",
192 | "transform-origin",
193 | "animation",
194 | "animation-name",
195 | "animation-duration",
196 | "animation-play-state",
197 | "animation-timing-function",
198 | "animation-delay",
199 | "animation-iteration-count",
200 | "animation-direction",
201 | "animation-fill-mode",
202 | "pointer-events",
203 | "unicode-bidi",
204 | "direction",
205 | "columns",
206 | "column-span",
207 | "column-width",
208 | "column-count",
209 | "column-fill",
210 | "column-gap",
211 | "column-rule",
212 | "column-rule-width",
213 | "column-rule-style",
214 | "column-rule-color",
215 | "break-before",
216 | "break-inside",
217 | "break-after",
218 | "page-break-before",
219 | "page-break-inside",
220 | "page-break-after",
221 | "orphans",
222 | "widows",
223 | "zoom",
224 | "max-zoom",
225 | "min-zoom",
226 | "user-zoom",
227 | "orientation",
228 | "user-select",
229 | "fill",
230 | "stroke"
231 | ],
232 | "unspecified-properties-position": "bottom"
233 | }
234 |
--------------------------------------------------------------------------------
/lib/presets/smacss.json:
--------------------------------------------------------------------------------
1 | {
2 | "sort-order": [
3 | "display",
4 | "position",
5 | "top",
6 | "right",
7 | "bottom",
8 | "left",
9 | "flex",
10 | "flex-basis",
11 | "flex-direction",
12 | "flex-flow",
13 | "flex-grow",
14 | "flex-shrink",
15 | "flex-wrap",
16 | "align-content",
17 | "align-items",
18 | "align-self",
19 | "justify-content",
20 | "order",
21 | "width",
22 | "min-width",
23 | "max-width",
24 | "height",
25 | "min-height",
26 | "max-height",
27 | "margin",
28 | "margin-top",
29 | "margin-right",
30 | "margin-bottom",
31 | "margin-left",
32 | "padding",
33 | "padding-top",
34 | "padding-right",
35 | "padding-bottom",
36 | "padding-left",
37 | "float",
38 | "clear",
39 | "columns",
40 | "column-gap",
41 | "column-fill",
42 | "column-rule",
43 | "column-span",
44 | "column-count",
45 | "column-width",
46 | "transform",
47 | "transform-box",
48 | "transform-origin",
49 | "transform-style",
50 | "transition",
51 | "transition-delay",
52 | "transition-duration",
53 | "transition-property",
54 | "transition-timing-function",
55 | "border",
56 | "border-top",
57 | "border-right",
58 | "border-bottom",
59 | "border-left",
60 | "border-width",
61 | "border-top-width",
62 | "border-right-width",
63 | "border-bottom-width",
64 | "border-left-width",
65 | "border-style",
66 | "border-top-style",
67 | "border-right-style",
68 | "border-bottom-style",
69 | "border-left-style",
70 | "border-radius",
71 | "border-top-left-radius",
72 | "border-top-right-radius",
73 | "border-bottom-left-radius",
74 | "border-bottom-right-radius",
75 | "border-color",
76 | "border-top-color",
77 | "border-right-color",
78 | "border-bottom-color",
79 | "border-left-color",
80 | "outline",
81 | "outline-color",
82 | "outline-offset",
83 | "outline-style",
84 | "outline-width",
85 | "background",
86 | "background-attachment",
87 | "background-color",
88 | "background-image",
89 | "background-repeat",
90 | "background-position",
91 | "background-size",
92 | "color",
93 | "font",
94 | "font-family",
95 | "font-size",
96 | "font-smoothing",
97 | "font-style",
98 | "font-variant",
99 | "font-weight",
100 | "letter-spacing",
101 | "line-height",
102 | "list-style",
103 | "text-align",
104 | "text-decoration",
105 | "text-indent",
106 | "text-overflow",
107 | "text-rendering",
108 | "text-shadow",
109 | "text-transform",
110 | "text-wrap",
111 | "white-space",
112 | "word-spacing",
113 | "border-collapse",
114 | "border-spacing",
115 | "box-shadow",
116 | "caption-side",
117 | "content",
118 | "cursor",
119 | "empty-cells",
120 | "opacity",
121 | "overflow",
122 | "quotes",
123 | "speak",
124 | "table-layout",
125 | "vertical-align",
126 | "visibility",
127 | "z-index"
128 | ]
129 | }
130 |
--------------------------------------------------------------------------------
/lib/presets/yandex.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties-order": [
3 | {
4 | "emptyLineBefore": true,
5 | "properties": [
6 | "font",
7 | "font-family",
8 | "font-size",
9 | "font-weight",
10 | "font-style",
11 | "font-variant",
12 | "font-size-adjust",
13 | "font-stretch",
14 | "font-effect",
15 | "font-emphasize",
16 | "font-emphasize-position",
17 | "font-emphasize-style",
18 | "font-smooth",
19 | "line-height",
20 | "text-size-adjust"
21 | ]
22 | },
23 | {
24 | "emptyLineBefore": true,
25 | "properties": [
26 | "position",
27 | "z-index",
28 | "top",
29 | "right",
30 | "bottom",
31 | "left"
32 | ]
33 | },
34 | {
35 | "emptyLineBefore": true,
36 | "properties": [
37 | "display",
38 | "visibility",
39 | "float",
40 | "clear",
41 | "overflow",
42 | "overflow-x",
43 | "overflow-y",
44 | "clip",
45 | "zoom",
46 | "flex-wrap",
47 | "flex-direction",
48 | "flex-order",
49 | "flex-pack",
50 | "flex-align",
51 | "align-content"
52 | ]
53 | },
54 | {
55 | "emptyLineBefore": true,
56 | "properties": [
57 | "box-sizing",
58 | "width",
59 | "min-width",
60 | "max-width",
61 | "height",
62 | "min-height",
63 | "max-height",
64 | "margin",
65 | "margin-top",
66 | "margin-right",
67 | "margin-bottom",
68 | "margin-left",
69 | "padding",
70 | "padding-top",
71 | "padding-right",
72 | "padding-bottom",
73 | "padding-left"
74 | ]
75 | },
76 | {
77 | "emptyLineBefore": true,
78 | "properties": [
79 | "table-layout",
80 | "empty-cells",
81 | "caption-side",
82 | "border-spacing",
83 | "border-collapse",
84 | "list-style",
85 | "list-style-position",
86 | "list-style-type",
87 | "list-style-image"
88 | ]
89 | },
90 | {
91 | "emptyLineBefore": true,
92 | "properties": [
93 | "content",
94 | "quotes",
95 | "counter-reset",
96 | "counter-increment",
97 | "resize",
98 | "cursor",
99 | "user-select",
100 | "touch-action",
101 | "nav-index",
102 | "nav-up",
103 | "nav-right",
104 | "nav-down",
105 | "nav-left",
106 | "transition",
107 | "transition-delay",
108 | "transition-timing-function",
109 | "transition-duration",
110 | "transition-property",
111 | "transform",
112 | "transform-origin",
113 | "animation",
114 | "animation-name",
115 | "animation-duration",
116 | "animation-play-state",
117 | "animation-timing-function",
118 | "animation-delay",
119 | "animation-iteration-count",
120 | "animation-direction",
121 | "text-align",
122 | "text-align-last",
123 | "vertical-align",
124 | "white-space",
125 | "text-decoration",
126 | "text-emphasis",
127 | "text-emphasis-color",
128 | "text-emphasis-style",
129 | "text-emphasis-position",
130 | "text-indent",
131 | "text-justify",
132 | "letter-spacing",
133 | "word-spacing",
134 | "text-outline",
135 | "text-transform",
136 | "text-wrap",
137 | "text-overflow",
138 | "text-overflow-ellipsis",
139 | "text-overflow-mode",
140 | "word-wrap",
141 | "word-break",
142 | "tab-size",
143 | "hyphens",
144 | "pointer-events"
145 | ]
146 | },
147 | {
148 | "emptyLineBefore": true,
149 | "properties": [
150 | "opacity",
151 | "color",
152 | "border",
153 | "border-width",
154 | "border-style",
155 | "border-color",
156 | "border-top",
157 | "border-top-width",
158 | "border-top-style",
159 | "border-top-color",
160 | "border-right",
161 | "border-right-width",
162 | "border-right-style",
163 | "border-right-color",
164 | "border-bottom",
165 | "border-bottom-width",
166 | "border-bottom-style",
167 | "border-bottom-color",
168 | "border-left",
169 | "border-left-width",
170 | "border-left-style",
171 | "border-left-color",
172 | "border-radius",
173 | "border-top-left-radius",
174 | "border-top-right-radius",
175 | "border-bottom-right-radius",
176 | "border-bottom-left-radius",
177 | "border-image",
178 | "border-image-source",
179 | "border-image-slice",
180 | "border-image-width",
181 | "border-image-outset",
182 | "border-image-repeat",
183 | "outline",
184 | "outline-width",
185 | "outline-style",
186 | "outline-color",
187 | "outline-offset",
188 | "background",
189 | "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
190 | "background-color",
191 | "background-image",
192 | "background-repeat",
193 | "background-attachment",
194 | "background-position",
195 | "background-position-x",
196 | "background-position-y",
197 | "background-clip",
198 | "background-origin",
199 | "background-size",
200 | "box-decoration-break",
201 | "box-shadow",
202 | "filter:progid:DXImageTransform.Microsoft.gradient",
203 | "text-shadow"
204 | ]
205 | }
206 | ]
207 | }
208 |
--------------------------------------------------------------------------------
/lib/presets/zen.json:
--------------------------------------------------------------------------------
1 | {
2 | "properties-order": [
3 | "position",
4 | "top",
5 | "right",
6 | "bottom",
7 | "left",
8 | "z-index",
9 | "display",
10 | "visibility",
11 | "flex-direction",
12 | "flex-order",
13 | "flex-pack",
14 | "float",
15 | "clear",
16 | "flex-align",
17 | "overflow",
18 | "overflow-x",
19 | "overflow-y",
20 | "overflow-scrolling",
21 | "clip",
22 | "box-sizing",
23 | "margin",
24 | "margin-top",
25 | "margin-right",
26 | "margin-bottom",
27 | "margin-left",
28 | "padding",
29 | "padding-top",
30 | "padding-right",
31 | "padding-bottom",
32 | "padding-left",
33 | "min-width",
34 | "min-height",
35 | "max-width",
36 | "max-height",
37 | "width",
38 | "height",
39 | "outline",
40 | "outline-width",
41 | "outline-style",
42 | "outline-color",
43 | "outline-offset",
44 | "border",
45 | "border-spacing",
46 | "border-collapse",
47 | "border-width",
48 | "border-style",
49 | "border-color",
50 | "border-top",
51 | "border-top-width",
52 | "border-top-style",
53 | "border-top-color",
54 | "border-right",
55 | "border-right-width",
56 | "border-right-style",
57 | "border-right-color",
58 | "border-bottom",
59 | "border-bottom-width",
60 | "border-bottom-style",
61 | "border-bottom-color",
62 | "border-left",
63 | "border-left-width",
64 | "border-left-style",
65 | "border-left-color",
66 | "border-radius",
67 | "border-top-left-radius",
68 | "border-top-right-radius",
69 | "border-bottom-right-radius",
70 | "border-bottom-left-radius",
71 | "border-image",
72 | "border-image-source",
73 | "border-image-slice",
74 | "border-image-width",
75 | "border-image-outset",
76 | "border-image-repeat",
77 | "border-top-image",
78 | "border-right-image",
79 | "border-bottom-image",
80 | "border-left-image",
81 | "border-corner-image",
82 | "border-top-left-image",
83 | "border-top-right-image",
84 | "border-bottom-right-image",
85 | "border-bottom-left-image",
86 | "background",
87 | "background-color",
88 | "background-image",
89 | "background-attachment",
90 | "background-position",
91 | "background-position-x",
92 | "background-position-y",
93 | "background-clip",
94 | "background-origin",
95 | "background-size",
96 | "background-repeat",
97 | "box-decoration-break",
98 | "box-shadow",
99 | "color",
100 | "table-layout",
101 | "caption-side",
102 | "empty-cells",
103 | "list-style",
104 | "list-style-position",
105 | "list-style-type",
106 | "list-style-image",
107 | "quotes",
108 | "content",
109 | "counter-increment",
110 | "counter-reset",
111 | "writing-mode",
112 | "vertical-align",
113 | "text-align",
114 | "text-align-last",
115 | "text-decoration",
116 | "text-emphasis",
117 | "text-emphasis-position",
118 | "text-emphasis-style",
119 | "text-emphasis-color",
120 | "text-indent",
121 | "text-justify",
122 | "text-outline",
123 | "text-transform",
124 | "text-wrap",
125 | "text-overflow",
126 | "text-overflow-ellipsis",
127 | "text-overflow-mode",
128 | "text-shadow",
129 | "white-space",
130 | "word-spacing",
131 | "word-wrap",
132 | "word-break",
133 | "tab-size",
134 | "hyphens",
135 | "letter-spacing",
136 | "font",
137 | "font-weight",
138 | "font-style",
139 | "font-variant",
140 | "font-size-adjust",
141 | "font-stretch",
142 | "font-size",
143 | "font-family",
144 | "src",
145 | "line-height",
146 | "opacity",
147 | "interpolation-mode",
148 | "filter",
149 | "resize",
150 | "cursor",
151 | "nav-index",
152 | "nav-up",
153 | "nav-right",
154 | "nav-down",
155 | "nav-left",
156 | "transition",
157 | "transition-delay",
158 | "transition-timing-function",
159 | "transition-duration",
160 | "transition-property",
161 | "transform",
162 | "transform-origin",
163 | "animation",
164 | "animation-name",
165 | "animation-duration",
166 | "animation-play-state",
167 | "animation-timing-function",
168 | "animation-delay",
169 | "animation-iteration-count",
170 | "animation-direction",
171 | "pointer-events",
172 | "unicode-bidi",
173 | "direction",
174 | "columns",
175 | "column-span",
176 | "column-width",
177 | "column-count",
178 | "column-fill",
179 | "column-gap",
180 | "column-rule",
181 | "column-rule-width",
182 | "column-rule-style",
183 | "column-rule-color",
184 | "break-before",
185 | "break-inside",
186 | "break-after",
187 | "page-break-before",
188 | "page-break-inside",
189 | "page-break-after",
190 | "orphans",
191 | "widows",
192 | "zoom",
193 | "max-zoom",
194 | "min-zoom",
195 | "user-zoom",
196 | "orientation"
197 | ]
198 | }
199 |
--------------------------------------------------------------------------------
/menus/postcss-sorting.cson:
--------------------------------------------------------------------------------
1 | 'context-menu':
2 | 'atom-text-editor': [
3 | {
4 | 'label': 'Run PostCSS Sorting'
5 | 'command': 'postcss-sorting:run'
6 | }
7 | ]
8 |
9 | 'menu': [
10 | {
11 | 'label': 'Packages'
12 | 'submenu': [
13 | 'label': 'PostCSS Sorting'
14 | 'submenu': [
15 | {
16 | 'label': 'Run'
17 | 'command': 'postcss-sorting:run'
18 | }
19 | ]
20 | ]
21 | }
22 | ]
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "postcss-sorting",
3 | "main": "./lib/postcss-sorting",
4 | "version": "2.10.0",
5 | "description": "Atom editor plugin to sort CSS rules content with specified order.",
6 | "repository": "https://github.com/lysyi3m/atom-postcss-sorting",
7 | "license": "MIT",
8 | "engines": {
9 | "atom": ">=1.0.0 <2.0.0"
10 | },
11 | "dependencies": {
12 | "postcss": "5.2.11",
13 | "postcss-scss": "0.4.0",
14 | "postcss-sorting": "2.0.1",
15 | "sugarss": "0.2.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------