texture_packer 1.6.3 → 1.7.0
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.
- checksums.yaml +4 -4
- data/lib/texture_packer.rb +2 -1
- data/lib/texture_packer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: db4f269ef958d7c784ff470d07e7dff3032ad71f4457bd362f9e5a83285dc0ef
|
|
4
|
+
data.tar.gz: b4d5db753edba2045a969a5aa25e4ce432239c29d999a9b2664a2f89043c2625
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec302b50ec8b948cbed1698539deeb14f41964e9d7478cca508b1dde774a502213681be51943c88f4110cc93f52474e1228dfd153131a14dccca0e4987965492
|
|
7
|
+
data.tar.gz: a93168b01427118b7e8bddf86ac76b106a2b0cc067ecf477f6f09a2185334bd80c6932185ea4292f4f4b7cc59e3ea7feefd23b412975a71714a8066aea4329f7
|
data/lib/texture_packer.rb
CHANGED
|
@@ -11,6 +11,7 @@ class TexturePacker
|
|
|
11
11
|
SPLIT_BY_MOBILE = 'mobile'
|
|
12
12
|
SPLIT_BY_I18N = 'i18n'
|
|
13
13
|
SPLIT_BY_I18N_AND_MOBILE = 'i18n_and_mobile'
|
|
14
|
+
SELECTOR_ORDER = %w[:hover :active :disabled].freeze
|
|
14
15
|
|
|
15
16
|
def initialize(dir_name, output_paths_mapping, content, split_type = nil)
|
|
16
17
|
@output_paths_mapping = output_paths_mapping
|
|
@@ -151,7 +152,7 @@ class TexturePacker
|
|
|
151
152
|
end
|
|
152
153
|
|
|
153
154
|
def generate_css
|
|
154
|
-
inner_css = @hash.map do |prefix, obj|
|
|
155
|
+
inner_css = @hash.sort_by{|prefix, obj| SELECTOR_ORDER.index(prefix) || SELECTOR_ORDER.size }.map do |prefix, obj|
|
|
155
156
|
case prefix
|
|
156
157
|
when nil, ''
|
|
157
158
|
[obj.generate_css]
|