dugway 1.0.10 → 1.0.12
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/README.md +1 -1
- data/lib/dugway/cli/build.rb +13 -2
- data/lib/dugway/cli/templates/dugway.tt +1 -1
- data/lib/dugway/cli/templates/source/layout.html +2 -2
- data/lib/dugway/cli/templates/source/settings.json +76 -4
- data/lib/dugway/cli/templates/source/stylesheets/_config.css.sass +12 -1
- data/lib/dugway/cli/templates/source/stylesheets/layout.css.sass +16 -16
- data/lib/dugway/cli/templates/source/stylesheets/products.css.sass +3 -3
- data/lib/dugway/cli/validate.rb +32 -0
- data/lib/dugway/cli.rb +3 -1
- data/lib/dugway/config/theme_color_attribute_mappings.yml +98 -0
- data/lib/dugway/theme.rb +41 -1
- data/lib/dugway/version.rb +1 -1
- data/spec/fixtures/theme/layout.html +3 -3
- data/spec/fixtures/theme/settings.json +45 -10
- data/spec/fixtures/theme/stylesheets/_partial.css +1 -1
- data/spec/fixtures/theme/stylesheets/one.css +1 -1
- data/spec/fixtures/theme/stylesheets/two.css.sass +3 -3
- data/spec/units/dugway/liquid/drops/theme_drop_spec.rb +11 -5
- data/spec/units/dugway/theme_spec.rb +19 -10
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca53a46e63f06064d7d5ff72d37a4056f99cd0210bd2ee12a3680bfe693bd84c
|
4
|
+
data.tar.gz: 4b05f6b48ba91601c4a78c45d2f64a614f6792411fd60f980a732d5e22ea3bf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 589bd59aa78d9ffb203fd0d323f051d764b7e74a9182cbe9b70cbc6361a3d055ca4bf4258c83d4804a127a9c16c7d6f191bef9dfe532658f0e056f7188efb588
|
7
|
+
data.tar.gz: 1fdf871fdb967fc908937524d48e5b7a431704b6b977b84037424006d9b3848d2c1db98026f8f89b13f720b4ba109e50af6b118bc540d7a178b809d197607a67
|
data/README.md
CHANGED
data/lib/dugway/cli/build.rb
CHANGED
@@ -5,6 +5,16 @@ module Dugway
|
|
5
5
|
class Build < Thor::Group
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
|
+
class_option 'skip-color-validation',
|
9
|
+
type: :boolean,
|
10
|
+
default: false,
|
11
|
+
desc: "Skip color settings validation"
|
12
|
+
|
13
|
+
class_option 'skip-layout-attribute-validation',
|
14
|
+
type: :boolean,
|
15
|
+
default: false,
|
16
|
+
desc: "Skip layout file data attribute validation"
|
17
|
+
|
8
18
|
def self.source_root
|
9
19
|
File.join(Dir.pwd, 'source')
|
10
20
|
end
|
@@ -14,9 +24,10 @@ module Dugway
|
|
14
24
|
end
|
15
25
|
|
16
26
|
def validate
|
17
|
-
unless theme.valid?
|
27
|
+
unless theme.valid?(validate_colors: !options['skip-color-validation'], validate_layout_attributes: !options['skip-layout-attribute-validation'])
|
18
28
|
theme.errors.each { |error| say(error, :red) }
|
19
|
-
|
29
|
+
say("\nTheme is invalid", :red)
|
30
|
+
exit(1)
|
20
31
|
end
|
21
32
|
end
|
22
33
|
|
@@ -94,8 +94,8 @@
|
|
94
94
|
</div>
|
95
95
|
|
96
96
|
<footer>
|
97
|
-
{% if theme.
|
98
|
-
<p><a href="
|
97
|
+
{% if theme.instagram_url != blank %}
|
98
|
+
<p><a href="{{ theme.instagram_url }}">Follow us on Instagram</a></p>
|
99
99
|
{% endif %}
|
100
100
|
</footer>
|
101
101
|
</body>
|
@@ -37,6 +37,53 @@
|
|
37
37
|
"default": "Helvetica"
|
38
38
|
}
|
39
39
|
],
|
40
|
+
"preset_styles": {
|
41
|
+
"preview": {
|
42
|
+
"title_font": "header_font",
|
43
|
+
"body_font": "text_font",
|
44
|
+
"text_color": "primary_text_color",
|
45
|
+
"background_color": "background_color"
|
46
|
+
},
|
47
|
+
"presets": [
|
48
|
+
{
|
49
|
+
"group_name": "Classic",
|
50
|
+
"styles": [
|
51
|
+
{
|
52
|
+
"style_name": "Classic #1",
|
53
|
+
"fonts": {
|
54
|
+
"header_font": "DM Sans",
|
55
|
+
"text_font": "DM Sans"
|
56
|
+
},
|
57
|
+
"colors": {
|
58
|
+
"background_color": "#FFFFFF",
|
59
|
+
"primary_text_color": "#000000",
|
60
|
+
"link_text_color": "#000000",
|
61
|
+
"link_hover_color": "#BF0101",
|
62
|
+
"button_background_color": "#000000",
|
63
|
+
"button_text_color": "#FFFFFF",
|
64
|
+
"button_hover_background_color": "#BF0101"
|
65
|
+
}
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"style_name": "Classic #2",
|
69
|
+
"fonts": {
|
70
|
+
"header_font": "Lora",
|
71
|
+
"text_font": "Roboto"
|
72
|
+
},
|
73
|
+
"colors": {
|
74
|
+
"background_color": "#F7F7F7",
|
75
|
+
"primary_text_color": "#222222",
|
76
|
+
"link_text_color": "#222222",
|
77
|
+
"link_hover_color": "#014ABF",
|
78
|
+
"button_background_color": "#222222",
|
79
|
+
"button_text_color": "#FFFFFF",
|
80
|
+
"button_hover_background_color": "#014ABF"
|
81
|
+
}
|
82
|
+
}
|
83
|
+
]
|
84
|
+
}
|
85
|
+
]
|
86
|
+
},
|
40
87
|
"colors": [
|
41
88
|
{
|
42
89
|
"variable": "background_color",
|
@@ -44,9 +91,34 @@
|
|
44
91
|
"default": "#FAFAFA"
|
45
92
|
},
|
46
93
|
{
|
47
|
-
"variable": "
|
94
|
+
"variable": "primary_text_color",
|
95
|
+
"label": "Text Color",
|
96
|
+
"default": "#222222"
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"variable": "link_text_color",
|
100
|
+
"label": "Text Color",
|
101
|
+
"default": "#222222"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"variable": "link_hover_color",
|
105
|
+
"label": "Text Color",
|
106
|
+
"default": "#014ABF"
|
107
|
+
},
|
108
|
+
{
|
109
|
+
"variable": "button_background_color",
|
48
110
|
"label": "Text Color",
|
49
111
|
"default": "#222222"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"variable": "button_text_color",
|
115
|
+
"label": "Text Color",
|
116
|
+
"default": "#FFFFFF"
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"variable": "button_hover_background_color",
|
120
|
+
"label": "Text Color",
|
121
|
+
"default": "#014ABF"
|
50
122
|
}
|
51
123
|
],
|
52
124
|
"options": [
|
@@ -74,10 +146,10 @@
|
|
74
146
|
"description": "The number of products shown per page"
|
75
147
|
},
|
76
148
|
{
|
77
|
-
"variable": "
|
78
|
-
"label": "
|
149
|
+
"variable": "instagram_url",
|
150
|
+
"label": "Instagram URL",
|
79
151
|
"type": "text",
|
80
|
-
"description": "Ex:
|
152
|
+
"description": "Ex: https://instagram.com/bigcartel"
|
81
153
|
}
|
82
154
|
]
|
83
155
|
}
|
@@ -1,2 +1,13 @@
|
|
1
|
-
$
|
1
|
+
$margin-size: 30px
|
2
2
|
$border: dashed 1px #ddd
|
3
|
+
|
4
|
+
$text-font: #{"{{ theme.text_font | font_family }}"}
|
5
|
+
$header-font: #{"{{ theme.header_font | font_family }}"}
|
6
|
+
|
7
|
+
$background-color: #{"{{ theme.background_color }}"}
|
8
|
+
$primary-text-color: #{"{{ theme.primary_text_color }}"}
|
9
|
+
$link-text-color: #{"{{ theme.link_text_color }}"}
|
10
|
+
$link-hover-color: #{"{{ theme.link_hover_color }}"}
|
11
|
+
$button-background-color: #{"{{ theme.button_background_color }}"}
|
12
|
+
$button-text-color: #{"{{ theme.button_text_color }}"}
|
13
|
+
$button-hover-background-color: #{"{{ theme.button_hover_background_color }}"}
|
@@ -1,17 +1,17 @@
|
|
1
1
|
@import 'config'
|
2
2
|
|
3
3
|
body
|
4
|
-
background:
|
5
|
-
color:
|
6
|
-
font: 14px/1.4 normal
|
4
|
+
background: $background-color
|
5
|
+
color: $primary-text-color
|
6
|
+
font: 14px/1.4 normal $text-font
|
7
7
|
margin: 100px
|
8
8
|
|
9
9
|
a
|
10
|
-
color:
|
10
|
+
color: $link-text-color
|
11
11
|
text-decoration: none
|
12
12
|
|
13
13
|
&:hover
|
14
|
-
color:
|
14
|
+
color: $link-hover-color
|
15
15
|
|
16
16
|
ul
|
17
17
|
list-style-type: disc
|
@@ -20,7 +20,7 @@ ol
|
|
20
20
|
list-style-type: decimal
|
21
21
|
|
22
22
|
ul, ol
|
23
|
-
margin-left: $
|
23
|
+
margin-left: $margin-size
|
24
24
|
|
25
25
|
ul.unstyled,
|
26
26
|
ol.unstyled
|
@@ -30,20 +30,20 @@ ol.unstyled
|
|
30
30
|
|
31
31
|
header
|
32
32
|
border-bottom: $border
|
33
|
-
font-family:
|
34
|
-
margin-bottom: $
|
35
|
-
padding-bottom: $
|
33
|
+
font-family: $header-font
|
34
|
+
margin-bottom: $margin-size
|
35
|
+
padding-bottom: $margin-size
|
36
36
|
text-align: center
|
37
37
|
|
38
38
|
a
|
39
|
-
color:
|
39
|
+
color: $link-text-color
|
40
40
|
font-size: 2.5em
|
41
41
|
|
42
42
|
&:hover
|
43
|
-
color:
|
43
|
+
color: $link-hover-color
|
44
44
|
|
45
45
|
h1, h2, h3, h4, h5
|
46
|
-
font-family:
|
46
|
+
font-family: $header-font
|
47
47
|
|
48
48
|
div.wrap
|
49
49
|
display: table
|
@@ -52,7 +52,7 @@ div.wrap
|
|
52
52
|
aside
|
53
53
|
border-right: $border
|
54
54
|
display: table-cell
|
55
|
-
padding-right: $
|
55
|
+
padding-right: $margin-size
|
56
56
|
width: 20%
|
57
57
|
|
58
58
|
section
|
@@ -66,15 +66,15 @@ aside
|
|
66
66
|
margin-bottom: .3em
|
67
67
|
|
68
68
|
a
|
69
|
-
color:
|
69
|
+
color: $link-text-color
|
70
70
|
font-size: .9em
|
71
71
|
|
72
72
|
&:hover
|
73
|
-
color:
|
73
|
+
color: $link-hover-color
|
74
74
|
|
75
75
|
section.content
|
76
76
|
display: table-cell
|
77
|
-
padding-left: $
|
77
|
+
padding-left: $margin-size
|
78
78
|
width: 80%
|
79
79
|
|
80
80
|
form
|
@@ -9,8 +9,8 @@ body#home, body#products
|
|
9
9
|
li.product
|
10
10
|
box-sizing: border-box
|
11
11
|
float: left
|
12
|
-
padding-bottom: $
|
13
|
-
padding-right: $
|
12
|
+
padding-bottom: $margin-size
|
13
|
+
padding-right: $margin-size
|
14
14
|
max-width: 30%
|
15
15
|
|
16
16
|
&:nth-child(3n+1)
|
@@ -18,7 +18,7 @@ body#home, body#products
|
|
18
18
|
|
19
19
|
img
|
20
20
|
display: block
|
21
|
-
margin-bottom: $
|
21
|
+
margin-bottom: $margin-size / 2
|
22
22
|
max-width: 100%
|
23
23
|
|
24
24
|
div.pagination
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module Dugway
|
2
|
+
module Cli
|
3
|
+
class Validate < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
class_option 'skip-color-validation',
|
7
|
+
type: :boolean,
|
8
|
+
default: false,
|
9
|
+
desc: "Skip color settings validation"
|
10
|
+
|
11
|
+
class_option 'skip-layout-attribute-validation',
|
12
|
+
type: :boolean,
|
13
|
+
default: false,
|
14
|
+
desc: "Skip layout file data attribute validation"
|
15
|
+
|
16
|
+
def validate
|
17
|
+
unless theme.valid?(validate_colors: !options['skip-color-validation'], validate_layout_attributes: !options['skip-layout-attribute-validation'])
|
18
|
+
theme.errors.each { |error| say(error, :red) }
|
19
|
+
say("\nTheme is invalid", :red)
|
20
|
+
exit(1)
|
21
|
+
end
|
22
|
+
say("Theme is valid!", :green)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def theme
|
28
|
+
@theme ||= Dugway.theme
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/dugway/cli.rb
CHANGED
@@ -5,6 +5,7 @@ require 'dugway'
|
|
5
5
|
require 'dugway/cli/build'
|
6
6
|
require 'dugway/cli/create'
|
7
7
|
require 'dugway/cli/server'
|
8
|
+
require 'dugway/cli/validate'
|
8
9
|
|
9
10
|
module Dugway
|
10
11
|
module Cli
|
@@ -12,7 +13,8 @@ module Dugway
|
|
12
13
|
register Create, 'create', 'create', 'Create a new Big Cartel theme'
|
13
14
|
register Build, 'build', 'build', 'Build your Big Cartel theme for use'
|
14
15
|
register Server, 'server', 'server', 'Run your Big Cartel theme in the browser'
|
15
|
-
|
16
|
+
register Validate, 'validate', 'validate', 'Validate your Big Cartel theme'
|
17
|
+
|
16
18
|
desc 'version', 'Show version of Dugway'
|
17
19
|
def version
|
18
20
|
say "Dugway #{ Dugway::VERSION }"
|
@@ -0,0 +1,98 @@
|
|
1
|
+
# Color attributes we require for each theme, which is important for the ThemeColorDrop in
|
2
|
+
# Storefront repo which we expose to sellers and 3rd party developers
|
3
|
+
required_color_attributes:
|
4
|
+
- background_color
|
5
|
+
- primary_text_color
|
6
|
+
- link_text_color
|
7
|
+
- link_hover_color
|
8
|
+
- button_background_color
|
9
|
+
- button_text_color
|
10
|
+
- button_hover_background_color
|
11
|
+
|
12
|
+
# Specify overrides when a theme does not use the standard color attributes
|
13
|
+
# Indicate when an attribute is not used by setting it to ~
|
14
|
+
Cosmos:
|
15
|
+
primary_text_color: text_color
|
16
|
+
|
17
|
+
Foundry:
|
18
|
+
link_text_color: primary_text_color
|
19
|
+
|
20
|
+
Good Vibes:
|
21
|
+
link_text_color: primary_text_color
|
22
|
+
link_hover_color: secondary_text_color
|
23
|
+
button_background_color: background_color
|
24
|
+
button_text_color: primary_text_color
|
25
|
+
button_hover_background_color: background_color
|
26
|
+
|
27
|
+
Hopscotch:
|
28
|
+
primary_text_color: text_color
|
29
|
+
link_text_color: text_color
|
30
|
+
link_hover_color: secondary_text_color
|
31
|
+
button_background_color: background_color
|
32
|
+
button_text_color: text_color
|
33
|
+
button_hover_background_color: ~
|
34
|
+
|
35
|
+
Luna:
|
36
|
+
link_text_color: primary_text_color
|
37
|
+
link_hover_color: link_rollover_color
|
38
|
+
button_hover_background_color: button_rollover_color
|
39
|
+
|
40
|
+
Lunch Break:
|
41
|
+
primary_text_color: text_color
|
42
|
+
link_text_color: text_color
|
43
|
+
button_hover_background_color: button_background_hover_color
|
44
|
+
|
45
|
+
Netizen:
|
46
|
+
primary_text_color: text_color
|
47
|
+
link_text_color: text_color
|
48
|
+
link_hover_color: ~
|
49
|
+
button_text_color: text_color
|
50
|
+
button_hover_background_color: ~
|
51
|
+
|
52
|
+
Nova:
|
53
|
+
button_background_color: background_color
|
54
|
+
button_text_color: primary_text_color
|
55
|
+
button_hover_background_color: background_color
|
56
|
+
|
57
|
+
PickleJuice:
|
58
|
+
primary_text_color: text_color
|
59
|
+
link_text_color: link_color
|
60
|
+
|
61
|
+
Ranger:
|
62
|
+
link_text_color: primary_text_color
|
63
|
+
button_hover_background_color: ~
|
64
|
+
|
65
|
+
Roadie:
|
66
|
+
primary_text_color: text_color
|
67
|
+
link_text_color: primary_text_color
|
68
|
+
|
69
|
+
Sidecar:
|
70
|
+
primary_text_color: body_text_color
|
71
|
+
link_text_color: link_color
|
72
|
+
button_hover_background_color: button_background_hover_color
|
73
|
+
|
74
|
+
Snacks:
|
75
|
+
primary_text_color: text_color
|
76
|
+
link_text_color: text_color
|
77
|
+
link_hover_color: ~
|
78
|
+
button_background_color: accent_background_color
|
79
|
+
button_text_color: accent_text_color
|
80
|
+
button_hover_background_color: ~
|
81
|
+
|
82
|
+
Snakebite:
|
83
|
+
primary_text_color: primary_color
|
84
|
+
link_text_color: primary_color
|
85
|
+
link_hover_color: primary_color
|
86
|
+
button_background_color: primary_color
|
87
|
+
button_text_color: primary_color
|
88
|
+
button_hover_background_color: primary_color
|
89
|
+
|
90
|
+
Sunscreen:
|
91
|
+
link_text_color: primary_text_color
|
92
|
+
|
93
|
+
Trace:
|
94
|
+
link_text_color: primary_text_color
|
95
|
+
link_hover_color: secondary_text_color
|
96
|
+
button_background_color: primary_text_color
|
97
|
+
button_text_color: background_color
|
98
|
+
button_hover_background_color: primary_text_color
|
data/lib/dugway/theme.rb
CHANGED
@@ -9,6 +9,10 @@ module Dugway
|
|
9
9
|
class Theme
|
10
10
|
REQUIRED_FILES = %w( cart.html contact.html home.html layout.html maintenance.html product.html products.html screenshot.jpg settings.json theme.css theme.js )
|
11
11
|
|
12
|
+
THEME_COLOR_ATTRIBUTE_MAPPINGS = YAML.load_file(
|
13
|
+
File.join(__dir__, 'config', 'theme_color_attribute_mappings.yml')
|
14
|
+
).freeze
|
15
|
+
|
12
16
|
attr_reader :errors
|
13
17
|
|
14
18
|
def initialize(overridden_customization={})
|
@@ -89,7 +93,7 @@ module Dugway
|
|
89
93
|
end
|
90
94
|
end
|
91
95
|
|
92
|
-
def valid?
|
96
|
+
def valid?(validate_colors: true, validate_layout_attributes: true)
|
93
97
|
@errors = []
|
94
98
|
|
95
99
|
REQUIRED_FILES.each do |file|
|
@@ -111,9 +115,45 @@ module Dugway
|
|
111
115
|
end
|
112
116
|
end
|
113
117
|
|
118
|
+
validate_required_color_settings if validate_colors
|
119
|
+
validate_required_layout_attributes if validate_layout_attributes
|
120
|
+
|
114
121
|
@errors.empty?
|
115
122
|
end
|
116
123
|
|
124
|
+
def validate_required_color_settings
|
125
|
+
required_colors_attribute_names = THEME_COLOR_ATTRIBUTE_MAPPINGS['required_color_attributes']
|
126
|
+
|
127
|
+
theme_colors = settings['colors'].map { |c| c['variable'] }
|
128
|
+
mappings = THEME_COLOR_ATTRIBUTE_MAPPINGS[name] || {}
|
129
|
+
|
130
|
+
missing_colors = required_colors_attribute_names.reject do |color|
|
131
|
+
theme_colors.include?(color) ||
|
132
|
+
(mappings.key?(color) && (mappings[color].nil? || theme_colors.include?(mappings[color])))
|
133
|
+
end
|
134
|
+
|
135
|
+
unless missing_colors.empty?
|
136
|
+
@errors << "Missing required color settings: #{missing_colors.join(', ')}"
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
# Validate that the Layout file has expected attributes for:
|
141
|
+
# - data-bc-page-type on the body tag
|
142
|
+
# - one data-bc-hook="header" and one data-bc-hook="footer" somewhere
|
143
|
+
def validate_required_layout_attributes
|
144
|
+
layout_content = read_source_file('layout.html')
|
145
|
+
|
146
|
+
unless layout_content =~ /<body[^>]*data-bc-page-type[^>]*>/
|
147
|
+
@errors << "layout.html missing `data-bc-page-type` attribute on body tag"
|
148
|
+
end
|
149
|
+
|
150
|
+
header_hooks = layout_content.scan(/data-bc-hook=(?:"|')header(?:"|')/).size
|
151
|
+
footer_hooks = layout_content.scan(/data-bc-hook=(?:"|')footer(?:"|')/).size
|
152
|
+
|
153
|
+
@errors << "layout.html must have exactly one `data-bc-hook=\"header\"`" if header_hooks != 1
|
154
|
+
@errors << "layout.html must have exactly one `data-bc-hook=\"footer\"`" if footer_hooks != 1
|
155
|
+
end
|
156
|
+
|
117
157
|
private
|
118
158
|
|
119
159
|
def validate_preview
|
data/lib/dugway/version.rb
CHANGED
@@ -11,8 +11,8 @@
|
|
11
11
|
{{ head_content }}
|
12
12
|
</head>
|
13
13
|
|
14
|
-
<body id="{{ page.permalink }}" class="{{ page.category }}">
|
15
|
-
<header>
|
14
|
+
<body id="{{ page.permalink }}" class="{{ page.category }}" data-bc-page-type="{% if page.category == 'custom' %}custom{% else %}{{ page.permalink }}{% endif %}">
|
15
|
+
<header data-bc-hook="header">
|
16
16
|
<a href="/" title="{{ store.name | escape }}">{{ store.name }}</a>
|
17
17
|
</header>
|
18
18
|
|
@@ -78,7 +78,7 @@
|
|
78
78
|
{% endif %}
|
79
79
|
</section>
|
80
80
|
|
81
|
-
<footer>
|
81
|
+
<footer data-bc-hook="footer">
|
82
82
|
<div>{{ powered_by_big_cartel }}</div>
|
83
83
|
</footer>
|
84
84
|
</body>
|
@@ -40,7 +40,7 @@
|
|
40
40
|
"default": "Helvetica"
|
41
41
|
},
|
42
42
|
{
|
43
|
-
"variable": "
|
43
|
+
"variable": "text_font",
|
44
44
|
"label": "Font",
|
45
45
|
"default": "Georgia"
|
46
46
|
}
|
@@ -48,8 +48,8 @@
|
|
48
48
|
"preset_styles": {
|
49
49
|
"preview": {
|
50
50
|
"title_font": "header_font",
|
51
|
-
"body_font": "
|
52
|
-
"text_color": "
|
51
|
+
"body_font": "text_font",
|
52
|
+
"text_color": "primary_text_color",
|
53
53
|
"background_color": "background_color"
|
54
54
|
},
|
55
55
|
"presets": [
|
@@ -60,22 +60,32 @@
|
|
60
60
|
"style_name": "Classic #1",
|
61
61
|
"fonts": {
|
62
62
|
"header_font": "DM Sans",
|
63
|
-
"
|
63
|
+
"text_font": "DM Sans"
|
64
64
|
},
|
65
65
|
"colors": {
|
66
66
|
"background_color": "#FFFFFF",
|
67
|
-
"
|
67
|
+
"primary_text_color": "#000000",
|
68
|
+
"link_text_color": "#000000",
|
69
|
+
"link_hover_color": "#BF0101",
|
70
|
+
"button_background_color": "#000000",
|
71
|
+
"button_text_color": "#FFFFFF",
|
72
|
+
"button_hover_background_color": "#BF0101"
|
68
73
|
}
|
69
74
|
},
|
70
75
|
{
|
71
76
|
"style_name": "Classic #2",
|
72
77
|
"fonts": {
|
73
78
|
"header_font": "Lora",
|
74
|
-
"
|
79
|
+
"text_font": "Roboto"
|
75
80
|
},
|
76
81
|
"colors": {
|
77
82
|
"background_color": "#F7F7F7",
|
78
|
-
"
|
83
|
+
"primary_text_color": "#222222",
|
84
|
+
"link_text_color": "#222222",
|
85
|
+
"link_hover_color": "#014ABF",
|
86
|
+
"button_background_color": "#222222",
|
87
|
+
"button_text_color": "#FFFFFF",
|
88
|
+
"button_hover_background_color": "#014ABF"
|
79
89
|
}
|
80
90
|
}
|
81
91
|
]
|
@@ -86,11 +96,36 @@
|
|
86
96
|
{
|
87
97
|
"variable": "background_color",
|
88
98
|
"label": "Background",
|
89
|
-
"default": "
|
99
|
+
"default": "white"
|
90
100
|
},
|
91
101
|
{
|
92
|
-
"variable": "
|
93
|
-
"label": "
|
102
|
+
"variable": "primary_text_color",
|
103
|
+
"label": "Text",
|
104
|
+
"default": "black"
|
105
|
+
},
|
106
|
+
{
|
107
|
+
"variable": "link_text_color",
|
108
|
+
"label": "Link text",
|
109
|
+
"default": "red"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"variable": "link_hover_color",
|
113
|
+
"label": "Link hover",
|
114
|
+
"default": "black"
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"variable": "button_background_color",
|
118
|
+
"label": "Button background",
|
119
|
+
"default": "black"
|
120
|
+
},
|
121
|
+
{
|
122
|
+
"variable": "button_text_color",
|
123
|
+
"label": "Button text",
|
124
|
+
"default": "white"
|
125
|
+
},
|
126
|
+
{
|
127
|
+
"variable": "button_hover_background_color",
|
128
|
+
"label": "Button hover background",
|
94
129
|
"default": "red"
|
95
130
|
}
|
96
131
|
],
|
@@ -1 +1 @@
|
|
1
|
-
$
|
1
|
+
$background_color: #0f0;
|
@@ -73,19 +73,25 @@ describe Dugway::Drops::ThemeDrop do
|
|
73
73
|
|
74
74
|
describe "#font" do
|
75
75
|
it "should return the theme's font" do
|
76
|
-
theme.
|
76
|
+
theme.text_font.should == 'Georgia'
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
describe "#background_color" do
|
81
81
|
it "should return the theme's background_color" do
|
82
|
-
theme.background_color.should == '
|
82
|
+
theme.background_color.should == 'white'
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
-
describe "#
|
87
|
-
it "should return the theme's
|
88
|
-
theme.
|
86
|
+
describe "#link_text_color" do
|
87
|
+
it "should return the theme's link_text_color" do
|
88
|
+
theme.link_text_color.should == 'red'
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe "#link_hover_color" do
|
93
|
+
it "should return the theme's link_hover_color" do
|
94
|
+
theme.link_hover_color.should == 'black'
|
89
95
|
end
|
90
96
|
end
|
91
97
|
|
@@ -18,7 +18,7 @@ describe Dugway::Theme do
|
|
18
18
|
describe "#fonts" do
|
19
19
|
it "should return a hash of font settings values" do
|
20
20
|
theme.fonts.should == {
|
21
|
-
'
|
21
|
+
'text_font' => 'Georgia',
|
22
22
|
'header_font' => 'Helvetica'
|
23
23
|
}
|
24
24
|
end
|
@@ -49,11 +49,16 @@ describe Dugway::Theme do
|
|
49
49
|
describe "#customization" do
|
50
50
|
it "should return a hash of font, color, option, images and image sets settings values" do
|
51
51
|
theme.customization.should == {
|
52
|
-
'background_color' => '
|
52
|
+
'background_color' => 'white',
|
53
53
|
'fixed_sidebar' => true,
|
54
|
-
'
|
54
|
+
'text_font' => 'Georgia',
|
55
55
|
'header_font' => 'Helvetica',
|
56
|
-
'
|
56
|
+
'primary_text_color' => 'black',
|
57
|
+
'link_text_color' => 'red',
|
58
|
+
'link_hover_color' => 'black',
|
59
|
+
'button_background_color' => 'black',
|
60
|
+
'button_text_color' => 'white',
|
61
|
+
'button_hover_background_color' => 'red',
|
57
62
|
'show_search' => false,
|
58
63
|
'logo' => { :url => 'images/logo_bc.png', :width => 1, :height => 1 },
|
59
64
|
'slideshow_images' => [
|
@@ -69,17 +74,22 @@ describe Dugway::Theme do
|
|
69
74
|
describe "when there are overridden customization" do
|
70
75
|
before(:each) do
|
71
76
|
Dugway.stub(:theme) {
|
72
|
-
Dugway::Theme.new(:fixed_sidebar => false, :
|
77
|
+
Dugway::Theme.new(:fixed_sidebar => false, :link_text_color => 'blue')
|
73
78
|
}
|
74
79
|
end
|
75
80
|
|
76
81
|
it "should merge those values into the defaults" do
|
77
82
|
theme.customization.should == {
|
78
|
-
'background_color' => '
|
83
|
+
'background_color' => 'white',
|
79
84
|
'fixed_sidebar' => false,
|
80
|
-
'
|
85
|
+
'text_font' => 'Georgia',
|
81
86
|
'header_font' => 'Helvetica',
|
82
|
-
'
|
87
|
+
'primary_text_color' => 'black',
|
88
|
+
'link_text_color' => 'blue',
|
89
|
+
'link_hover_color' => 'black',
|
90
|
+
'button_background_color' => 'black',
|
91
|
+
'button_text_color' => 'white',
|
92
|
+
'button_hover_background_color' => 'red',
|
83
93
|
'show_search' => false,
|
84
94
|
'logo' => { :url => 'images/logo_bc.png', :width => 1, :height => 1 },
|
85
95
|
'slideshow_images' => [
|
@@ -134,7 +144,7 @@ describe Dugway::Theme do
|
|
134
144
|
end
|
135
145
|
|
136
146
|
it "should sprocketize and not liquify theme.css" do
|
137
|
-
theme.build_file('theme.css').gsub(/\s+/, '').should == %{html,body{height:100%;}a{background:#0f0;color:{{theme.
|
147
|
+
theme.build_file('theme.css').gsub(/\s+/, '').should == %{html,body{height:100%;}a{background:#0f0;color:{{theme.link_text_color}};}/**/}
|
138
148
|
end
|
139
149
|
end
|
140
150
|
|
@@ -227,4 +237,3 @@ describe Dugway::Theme do
|
|
227
237
|
File.read(File.join(Dugway.source_dir, file_name))
|
228
238
|
end
|
229
239
|
end
|
230
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dugway
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Big Cartel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -466,6 +466,8 @@ files:
|
|
466
466
|
- lib/dugway/cli/templates/source/stylesheets/vendor/normalize.css
|
467
467
|
- lib/dugway/cli/templates/source/theme.css
|
468
468
|
- lib/dugway/cli/templates/source/theme.js
|
469
|
+
- lib/dugway/cli/validate.rb
|
470
|
+
- lib/dugway/config/theme_color_attribute_mappings.yml
|
469
471
|
- lib/dugway/contact_form_validator.rb
|
470
472
|
- lib/dugway/controller.rb
|
471
473
|
- lib/dugway/extensions/time.rb
|