scss_beautifier 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.travis.yml +5 -0
  4. data/CODE_OF_CONDUCT.md +49 -0
  5. data/Gemfile +4 -0
  6. data/Gemfile.lock +32 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +31 -0
  9. data/Rakefile +10 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/data/default_config.yml +49 -0
  13. data/data/pseudo_elements.txt +97 -0
  14. data/exe/scss-beautify +6 -0
  15. data/lib/scss_beautifier.rb +35 -0
  16. data/lib/scss_beautifier/cli.rb +20 -0
  17. data/lib/scss_beautifier/config.rb +21 -0
  18. data/lib/scss_beautifier/convert.rb +31 -0
  19. data/lib/scss_beautifier/formatters/bang_format.rb +21 -0
  20. data/lib/scss_beautifier/formatters/border_zero.rb +22 -0
  21. data/lib/scss_beautifier/formatters/color.rb +24 -0
  22. data/lib/scss_beautifier/formatters/comment.rb +17 -0
  23. data/lib/scss_beautifier/formatters/debug.rb +8 -0
  24. data/lib/scss_beautifier/formatters/declaration_order.rb +23 -0
  25. data/lib/scss_beautifier/formatters/empty_rule.rb +19 -0
  26. data/lib/scss_beautifier/formatters/leading_zero.rb +12 -0
  27. data/lib/scss_beautifier/formatters/name_format.rb +45 -0
  28. data/lib/scss_beautifier/formatters/property_sort_order.rb +23 -0
  29. data/lib/scss_beautifier/formatters/pseudo_element.rb +20 -0
  30. data/lib/scss_beautifier/formatters/qualifying_element.rb +14 -0
  31. data/lib/scss_beautifier/formatters/selector.rb +8 -0
  32. data/lib/scss_beautifier/formatters/shorthand.rb +112 -0
  33. data/lib/scss_beautifier/formatters/string_quotes.rb +33 -0
  34. data/lib/scss_beautifier/formatters/trailing_zero.rb +24 -0
  35. data/lib/scss_beautifier/options.rb +94 -0
  36. data/lib/scss_beautifier/version.rb +3 -0
  37. data/scss_beautifier.gemspec +28 -0
  38. data/tmp/bang.scss +3 -0
  39. data/tmp/border0.scss +3 -0
  40. data/tmp/colorkeyword.scss +3 -0
  41. data/tmp/colorshort.scss +3 -0
  42. data/tmp/comments.scss +5 -0
  43. data/tmp/debug.scss +4 -0
  44. data/tmp/declarationorder.scss +31 -0
  45. data/tmp/dump.mdown +63 -0
  46. data/tmp/elseplacement.scss +18 -0
  47. data/tmp/empty.scss +3 -0
  48. data/tmp/leadingzero.scss +17 -0
  49. data/tmp/nameformat.scss +30 -0
  50. data/tmp/pm.scss +228 -0
  51. data/tmp/pm2.scss +235 -0
  52. data/tmp/propertysortorder.scss +19 -0
  53. data/tmp/pseudoelement.scss +13 -0
  54. data/tmp/qualifyingelement.scss +23 -0
  55. data/tmp/selectors.scss +3 -0
  56. data/tmp/shorthand.scss +15 -0
  57. data/tmp/string_quotes.scss +12 -0
  58. data/tmp/test.scss +1 -0
  59. data/tmp/test2.scss +35 -0
  60. data/tmp/trailing_zero.scss +15 -0
  61. metadata +176 -0
data/tmp/pm2.scss ADDED
@@ -0,0 +1,235 @@
1
+ // override styles for typeahead
2
+ ul.private-message-dropdown-menu {
3
+ border: none;
4
+ display: none;
5
+ list-style-position: outside;
6
+ list-style: none;
7
+ overflow-y: auto;
8
+ padding: 0 0 5px 0;
9
+ position: absolute;
10
+ width: 100%;
11
+ z-index: 1000;
12
+
13
+ @include calc(height, "100% - 350px");
14
+
15
+ @include scrollbar($alto, rgba(0, 0, 0, 0));
16
+
17
+ li {
18
+ cursor: pointer;
19
+ border-bottom: 1px solid $alto;
20
+ display: list-item;
21
+ margin: 0;
22
+ overflow: hidden;
23
+ padding: 12px;
24
+
25
+ a {
26
+ color: $charcoal;
27
+ font-size: 16px;
28
+
29
+ strong {
30
+ font-weight: normal;
31
+ }
32
+ }
33
+
34
+ &.active {
35
+ background-color: $alabaster;
36
+
37
+ a {
38
+ color: $driftwood;
39
+ text-decoration: none;
40
+ }
41
+ }
42
+ }
43
+ }
44
+
45
+ // Private message write a message form
46
+ .write-a-message-form {
47
+ background: $white;
48
+ bottom: 20px;
49
+ position: absolute;
50
+
51
+ @include calc(width, "100% - 40px");
52
+ }
53
+
54
+ // Private Message pane that holds the conversation (right pane)
55
+ .conversation {
56
+ padding-bottom: 90px;
57
+ position: relative;
58
+
59
+ // Each message
60
+ .convo {
61
+ font-size: 16px;
62
+ padding: 15px 20px;
63
+ }
64
+ }
65
+
66
+ // Private message conversation list (right pane)
67
+ .private_messages {
68
+ overflow-x: hidden !important;
69
+ overflow-y: scroll !important;
70
+ padding: 30px 0 0 0;
71
+
72
+ @include calc(height, "100% - 192px");
73
+
74
+ @include scrollbar($alto, rgba(0, 0, 0, 0));
75
+
76
+ &::-webkit-scrollbar-thumb {
77
+ border: none;
78
+ }
79
+ }
80
+
81
+ // Private message conversation list div (left pane)
82
+ .conversation-list-wrapper {
83
+ @include scrollbar($alto, rgba(0, 0, 0, 0));
84
+ }
85
+
86
+ // The date dividers in Private message conversation
87
+ .divider {
88
+ text-align: center !important;
89
+
90
+ .divider-time {
91
+ background: $white;
92
+ color: $silver;
93
+ font-size: 14px;
94
+ margin: 0 auto;
95
+ position: relative;
96
+ width: 150px;
97
+ z-index: 1;
98
+ }
99
+
100
+ .divider__fade {
101
+ border: none;
102
+ height: auto;
103
+ position: relative;
104
+
105
+ &:after {
106
+ bottom: 7px;
107
+ content: "";
108
+ height: 1px;
109
+ left: 0;
110
+ position: absolute;
111
+ right: 0px;
112
+
113
+ @include background-image(linear-gradient(left, transparent -6%, $alto, transparent 110%));
114
+ }
115
+ }
116
+ }
117
+
118
+ // CTA when user is logged out and trying to view PM page
119
+ .blocked-cta {
120
+ font-size: 1.30em;
121
+ margin: 20px 0;
122
+ text-align: center;
123
+
124
+ a:active,
125
+ a:link,
126
+ a:hover,
127
+ a:visited {
128
+ color: $driftwood;
129
+ }
130
+ }
131
+
132
+ // Host reciever name is special
133
+ .host .receiver-name {
134
+ color: $driftwood;
135
+ }
136
+
137
+ // state of the partner
138
+ .state {
139
+ font-style: italic;
140
+ margin-left: 5px;
141
+ text-transform: capitalize;
142
+
143
+ &.state-attending {
144
+ color: $light_green;
145
+ }
146
+
147
+ &.state-regrets {
148
+ color: $cornflower;
149
+ }
150
+
151
+ &.state-added,
152
+ &.state-new,
153
+ &.state-opened,
154
+ &.state-registered,
155
+ &.state-undeliverable {
156
+ color: $white;
157
+ }
158
+ }
159
+
160
+ .pvt-msg__submit {
161
+ float: right;
162
+ margin-top: 10px;
163
+ }
164
+
165
+ // Write a message form that pertains to a particuliar guest (as opposed to New Recipient view)
166
+ .guest-message-form {
167
+ margin: 0;
168
+
169
+ span {
170
+ display: inline-block;
171
+ font-size: 16px;
172
+ position: absolute;
173
+ vertical-align: top;
174
+ }
175
+
176
+ .search-icon {
177
+ position: absolute;
178
+ right: 30px;
179
+
180
+ .svg-search {
181
+ fill: $alto;
182
+ height: 18px;
183
+ width: 18px;
184
+ }
185
+ }
186
+
187
+ textarea {
188
+ overflow-y: hidden;
189
+ }
190
+ }
191
+
192
+ // Search for name input
193
+ .new-recipient {
194
+ border: none;
195
+ border-bottom: 1px solid $alto;
196
+ font-size: 16px;
197
+ height: 40px;
198
+ line-height: 1em;
199
+ margin-top: 0;
200
+ padding: 0 0 19px 30px;
201
+ width: 100%;
202
+
203
+ @include input-placeholder {
204
+ padding: 0 0 0 1px;
205
+ }
206
+ }
207
+
208
+ // override for signup/login modals
209
+ .ui-modal .pane {
210
+ padding: 0;
211
+ }
212
+
213
+ @include breakpoint($fullscreen) {
214
+ // Private message write a message form
215
+ .write-a-message-form {
216
+ width: 400px;
217
+ }
218
+ }
219
+
220
+
221
+ .pvt-msg__header-name {
222
+ border-bottom: solid 4px transparent;
223
+ color: $charcoal;
224
+ display: block;
225
+ font-size: 13px;
226
+ letter-spacing: 0.15em;
227
+ line-height: 1.5em;
228
+ margin: 25px auto 0;
229
+ min-height: 38px;
230
+ padding: 0 7px 18px;
231
+ position: relative;
232
+ text-transform: uppercase;
233
+ width: 70%;
234
+ word-wrap: break-word;
235
+ }
@@ -0,0 +1,19 @@
1
+ .rule1 {
2
+ @extend %placeholder;
3
+ @extend %placeholder-2;
4
+
5
+ color: $black;
6
+ padding: 10px;
7
+ display: block;
8
+ @extend %placeholder2;
9
+ text-transform: uppercase;;
10
+ margin: 20px 0;
11
+
12
+ .secondary-rule {
13
+ position: absolute;
14
+ display: inline-block;
15
+ padding: 10px 0;
16
+ @include box-shadow(border-box);
17
+ color: $black;
18
+ }
19
+ }
@@ -0,0 +1,13 @@
1
+ .test {
2
+ &:before {
3
+ color: $something;
4
+ }
5
+ }
6
+
7
+ .selector::after {
8
+ color: $somthing;
9
+
10
+ &::hover {
11
+ background-color: $red;
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ div.class {
2
+ color: $green;
3
+ }
4
+
5
+ .class {
6
+ color: $green;
7
+ }
8
+
9
+ a#id {
10
+ color: $green;
11
+ }
12
+
13
+ #id {
14
+ color: $green;
15
+ }
16
+
17
+ span[data-id="test"] {
18
+ color: $green;
19
+ }
20
+
21
+ [data-id="test"] {
22
+ color: $green;
23
+ }
@@ -0,0 +1,3 @@
1
+ .selector1,.selector2,.selector3 {
2
+ font-size: 10px;
3
+ }
@@ -0,0 +1,15 @@
1
+ .test {
2
+ margin: 1px 1px 1px 1px;
3
+ padding: 1px 5px;
4
+ }
5
+
6
+ .test2 {
7
+ padding: 2px 5px 1px;
8
+ margin: 5px 1px 6px 4px;
9
+ }
10
+
11
+ .more-test {
12
+ margin: 10px 2px 4px 2px;
13
+ padding: 14px;
14
+ border-color: red green red green;
15
+ }
@@ -0,0 +1,12 @@
1
+ .test {
2
+ color: $black;
3
+ content: 'hello';
4
+ content: "hello";
5
+ content: "'hello'";
6
+
7
+ .nested-child {
8
+ content: 'hello';
9
+ content: "hello";
10
+ content: "'hello'";
11
+ }
12
+ }
data/tmp/test.scss ADDED
@@ -0,0 +1 @@
1
+ .test { color: #f00;}
data/tmp/test2.scss ADDED
@@ -0,0 +1,35 @@
1
+ // hmm
2
+ // what #{$version}
3
+ // lolnoextra
4
+ //
5
+ // bad comment
6
+ .a {
7
+ .nested {
8
+ color: #000 ! important;
9
+ }
10
+
11
+ padding: 1px;
12
+ font-size: 12px !important;
13
+ border: 0;
14
+ }
15
+
16
+ .b { border: 0 1px;
17
+ }
18
+
19
+ .c,.d {
20
+ border-bottom: 1px solid $alto;
21
+ }
22
+
23
+ .space {
24
+ @include box-shadow(0 2px 2px rgba(0, 0, 0, 0.2));
25
+
26
+ $my-color: #fff;
27
+
28
+ color: rgba(0, 0, 0, 0.1);
29
+ width: 5+5;content: "hello";
30
+ }
31
+
32
+ .empty {
33
+
34
+ }
35
+ // Photos pages svg styles
@@ -0,0 +1,15 @@
1
+ .test {
2
+ margin: .500em;
3
+ margin: .5em;
4
+ margin: 1.250em;
5
+ margin: .6000000em;
6
+ margin: 1.0em;
7
+
8
+ .test-2 {
9
+ margin: ".500em";
10
+ margin: .5em;
11
+ margin: "1.250em";
12
+ margin: .6000000em;
13
+ margin: "1.0em";
14
+ }
15
+ }
metadata ADDED
@@ -0,0 +1,176 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: scss_beautifier
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Ivan Tse
8
+ - Joe Natalzia
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2016-08-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sass
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '3.4'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '3.4'
28
+ - !ruby/object:Gem::Dependency
29
+ name: bundler
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '1.12'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '1.12'
42
+ - !ruby/object:Gem::Dependency
43
+ name: rake
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '10.0'
49
+ type: :development
50
+ prerelease: false
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '10.0'
56
+ - !ruby/object:Gem::Dependency
57
+ name: minitest
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '5.0'
63
+ type: :development
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '5.0'
70
+ - !ruby/object:Gem::Dependency
71
+ name: pry
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ description: Transforms SCSS code to have consistent formatting
85
+ email:
86
+ - ivan.tse1@gmail.com
87
+ - jnatalzia@gmail.com
88
+ executables:
89
+ - scss-beautify
90
+ extensions: []
91
+ extra_rdoc_files: []
92
+ files:
93
+ - ".gitignore"
94
+ - ".travis.yml"
95
+ - CODE_OF_CONDUCT.md
96
+ - Gemfile
97
+ - Gemfile.lock
98
+ - LICENSE.txt
99
+ - README.md
100
+ - Rakefile
101
+ - bin/console
102
+ - bin/setup
103
+ - data/default_config.yml
104
+ - data/pseudo_elements.txt
105
+ - exe/scss-beautify
106
+ - lib/scss_beautifier.rb
107
+ - lib/scss_beautifier/cli.rb
108
+ - lib/scss_beautifier/config.rb
109
+ - lib/scss_beautifier/convert.rb
110
+ - lib/scss_beautifier/formatters/bang_format.rb
111
+ - lib/scss_beautifier/formatters/border_zero.rb
112
+ - lib/scss_beautifier/formatters/color.rb
113
+ - lib/scss_beautifier/formatters/comment.rb
114
+ - lib/scss_beautifier/formatters/debug.rb
115
+ - lib/scss_beautifier/formatters/declaration_order.rb
116
+ - lib/scss_beautifier/formatters/empty_rule.rb
117
+ - lib/scss_beautifier/formatters/leading_zero.rb
118
+ - lib/scss_beautifier/formatters/name_format.rb
119
+ - lib/scss_beautifier/formatters/property_sort_order.rb
120
+ - lib/scss_beautifier/formatters/pseudo_element.rb
121
+ - lib/scss_beautifier/formatters/qualifying_element.rb
122
+ - lib/scss_beautifier/formatters/selector.rb
123
+ - lib/scss_beautifier/formatters/shorthand.rb
124
+ - lib/scss_beautifier/formatters/string_quotes.rb
125
+ - lib/scss_beautifier/formatters/trailing_zero.rb
126
+ - lib/scss_beautifier/options.rb
127
+ - lib/scss_beautifier/version.rb
128
+ - scss_beautifier.gemspec
129
+ - tmp/bang.scss
130
+ - tmp/border0.scss
131
+ - tmp/colorkeyword.scss
132
+ - tmp/colorshort.scss
133
+ - tmp/comments.scss
134
+ - tmp/debug.scss
135
+ - tmp/declarationorder.scss
136
+ - tmp/dump.mdown
137
+ - tmp/elseplacement.scss
138
+ - tmp/empty.scss
139
+ - tmp/leadingzero.scss
140
+ - tmp/nameformat.scss
141
+ - tmp/pm.scss
142
+ - tmp/pm2.scss
143
+ - tmp/propertysortorder.scss
144
+ - tmp/pseudoelement.scss
145
+ - tmp/qualifyingelement.scss
146
+ - tmp/selectors.scss
147
+ - tmp/shorthand.scss
148
+ - tmp/string_quotes.scss
149
+ - tmp/test.scss
150
+ - tmp/test2.scss
151
+ - tmp/trailing_zero.scss
152
+ homepage: https://github.com/paperlesspost/scss-beautifier
153
+ licenses:
154
+ - MIT
155
+ metadata: {}
156
+ post_install_message:
157
+ rdoc_options: []
158
+ require_paths:
159
+ - lib
160
+ required_ruby_version: !ruby/object:Gem::Requirement
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ requirements: []
171
+ rubyforge_project:
172
+ rubygems_version: 2.2.2
173
+ signing_key:
174
+ specification_version: 4
175
+ summary: Beautify your SCSS code
176
+ test_files: []