fontcustom_canvas 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -4
- data/fontcustom_canvas-0.1.0.gem +0 -0
- data/fontcustom_canvas-0.1.1.gem +0 -0
- data/fontcustom_canvas.gemspec +1 -0
- data/lib/fontcustom_canvas.rb +5 -5
- data/lib/fontcustom_canvas/version.rb +1 -1
- data/public/_ic-typography.scss +629 -0
- data/public/_ic_app_header.scss +463 -0
- data/public/_variables.scss +298 -0
- data/public/brandable_css.rb +374 -0
- data/public/brandable_variables.json +233 -0
- data/public/theme_editor/Fonts.js +92 -0
- data/public/theme_editor/PropTypes.js +130 -0
- data/public/theme_editor/ThemeEditorAccordion.js +131 -0
- data/public/theme_editor/ThemeEditorFontFamilyRow.js +147 -0
- data/public/theme_editor/ThemeEditorFontSizeRow.js +152 -0
- data/public/theme_editor/ThemeEditorFontWeightRow.js +176 -0
- metadata +30 -3
@@ -0,0 +1,233 @@
|
|
1
|
+
|
2
|
+
[{
|
3
|
+
"group_key": "global_branding",
|
4
|
+
"variables": [{
|
5
|
+
"variable_name": "ic-brand-primary",
|
6
|
+
"type": "color",
|
7
|
+
"default": "#008EE2"
|
8
|
+
},{
|
9
|
+
"variable_name": "ic-brand-font-color-dark",
|
10
|
+
"type": "color",
|
11
|
+
"default": "#2D3B45"
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"variable_name": "ic-brand-font-family",
|
15
|
+
"type": "fontFamily",
|
16
|
+
"default": "'Lato Extended', 'Lato', 'Helvetica Neue', Helvetica, Arial, sans-serif)"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"variable_name": "ic-brand-font-size",
|
20
|
+
"type": "fontSize",
|
21
|
+
"default": "16px"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"variable_name": "ic-brand-font-weight",
|
25
|
+
"type": "fontWeight",
|
26
|
+
"default": "normal"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"variable_name": "ic-link-color",
|
30
|
+
"type": "color",
|
31
|
+
"default": "#008EE2"
|
32
|
+
},{
|
33
|
+
"variable_name": "ic-brand-button--primary-bgd",
|
34
|
+
"type": "color",
|
35
|
+
"default": "$ic-brand-primary"
|
36
|
+
},{
|
37
|
+
"variable_name": "ic-brand-button--primary-text",
|
38
|
+
"type": "color",
|
39
|
+
"default": "#ffffff"
|
40
|
+
},{
|
41
|
+
"variable_name": "ic-brand-button--secondary-bgd",
|
42
|
+
"type": "color",
|
43
|
+
"default": "#2D3B45"
|
44
|
+
},{
|
45
|
+
"variable_name": "ic-brand-button--secondary-text",
|
46
|
+
"type": "color",
|
47
|
+
"default": "#ffffff"
|
48
|
+
}
|
49
|
+
]},
|
50
|
+
{
|
51
|
+
"group_key": "global_navigation",
|
52
|
+
"variables": [
|
53
|
+
{
|
54
|
+
"variable_name": "ic-brand-global-nav-bgd",
|
55
|
+
"type": "color",
|
56
|
+
"default": "#394B58"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"variable_name": "ic-brand-global-nav-ic-icon-svg-fill",
|
60
|
+
"type": "color",
|
61
|
+
"default": "#ffffff"
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"variable_name": "ic-brand-global-nav-ic-icon-svg-fill--active",
|
65
|
+
"type": "color",
|
66
|
+
"default": "$ic-brand-primary"
|
67
|
+
},
|
68
|
+
{
|
69
|
+
"variable_name": "ic-brand-global-nav-menu-item__text-color",
|
70
|
+
"type": "color",
|
71
|
+
"default": "#ffffff"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"variable_name": "ic-brand-global-nav-menu-item__text-color--active",
|
75
|
+
"type": "color",
|
76
|
+
"default": "$ic-link-color"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"variable_name": "ic-brand-global-nav-avatar-border",
|
80
|
+
"type": "color",
|
81
|
+
"default": "#ffffff"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"variable_name": "ic-brand-global-nav-menu-item__badge-bgd",
|
85
|
+
"type": "color",
|
86
|
+
"default": "$ic-brand-primary"
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"variable_name": "ic-brand-global-nav-menu-item__badge-text",
|
90
|
+
"type": "color",
|
91
|
+
"default": "#ffffff"
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"variable_name": "ic-brand-global-nav-logo-bgd",
|
95
|
+
"type": "color",
|
96
|
+
"default": "#394B58"
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"variable_name": "ic-brand-header-image",
|
100
|
+
"type": "image",
|
101
|
+
"accept": "image/png,image/gif,image/jpeg,image/svg+xml,image/svg",
|
102
|
+
"default": "/images/canvas_logomark_only@2x.png"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"variable_name": "ic-brand-mobile-global-nav-logo",
|
106
|
+
"type": "image",
|
107
|
+
"accept": "image/png,image/gif,image/jpeg,image/svg+xml,image/svg",
|
108
|
+
"default": "/images/mobile-global-nav-logo.svg"
|
109
|
+
}
|
110
|
+
]},
|
111
|
+
{
|
112
|
+
"group_key": "watermarks",
|
113
|
+
"variables": [{
|
114
|
+
"variable_name": "ic-brand-watermark",
|
115
|
+
"type": "image",
|
116
|
+
"accept": "image/png,image/svg+xml,image/svg,image/gif,image/jpeg",
|
117
|
+
"default": ""
|
118
|
+
},{
|
119
|
+
"variable_name": "ic-brand-watermark-opacity",
|
120
|
+
"type": "percentage",
|
121
|
+
"default": "1.0"
|
122
|
+
},{
|
123
|
+
"variable_name": "ic-brand-favicon",
|
124
|
+
"type": "image",
|
125
|
+
"accept": "image/vnd.microsoft.icon,image/x-icon,image/png,image/gif",
|
126
|
+
"default": "/images/favicon.ico"
|
127
|
+
},{
|
128
|
+
"variable_name": "ic-brand-apple-touch-icon",
|
129
|
+
"type": "image",
|
130
|
+
"accept": "image/png",
|
131
|
+
"default": "/images/apple-touch-icon.png"
|
132
|
+
},{
|
133
|
+
"variable_name": "ic-brand-msapplication-tile-color",
|
134
|
+
"type": "color",
|
135
|
+
"default": "$ic-brand-primary"
|
136
|
+
},{
|
137
|
+
"variable_name": "ic-brand-msapplication-tile-square",
|
138
|
+
"type": "image",
|
139
|
+
"accept": "image/png,image/gif,image/jpeg",
|
140
|
+
"default": "/images/windows-tile.png"
|
141
|
+
},{
|
142
|
+
"variable_name": "ic-brand-msapplication-tile-wide",
|
143
|
+
"type": "image",
|
144
|
+
"accept": "image/png,image/gif,image/jpeg",
|
145
|
+
"default": "/images/windows-tile-wide.png"
|
146
|
+
},{
|
147
|
+
"variable_name": "ic-brand-right-sidebar-logo",
|
148
|
+
"type": "image",
|
149
|
+
"accept": "image/svg+xml,image/svg,image/png,image/gif,image/jpeg",
|
150
|
+
"default": ""
|
151
|
+
}
|
152
|
+
]},
|
153
|
+
{
|
154
|
+
"group_key": "login",
|
155
|
+
"variables": [{
|
156
|
+
"variable_name": "ic-brand-Login-body-bgd-color",
|
157
|
+
"type": "color",
|
158
|
+
"default": "#394B58"
|
159
|
+
},
|
160
|
+
{
|
161
|
+
"variable_name": "ic-brand-Login-body-bgd-image",
|
162
|
+
"type": "image",
|
163
|
+
"accept": "image/png,image/svg+xml,image/svg,image/gif,image/jpeg",
|
164
|
+
"default": ""
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"variable_name": "ic-brand-Login-body-bgd-shadow-color",
|
168
|
+
"type": "color",
|
169
|
+
"default": "#2D3B45"
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"variable_name": "ic-brand-Login-logo",
|
173
|
+
"type": "image",
|
174
|
+
"accept": "image/png,image/gif,image/jpeg, image/svg+xml,image/svg",
|
175
|
+
"default": "/images/login/canvas-logo.svg"
|
176
|
+
},
|
177
|
+
{
|
178
|
+
"variable_name": "ic-brand-Login-Content-bgd-color",
|
179
|
+
"type": "color",
|
180
|
+
"default": "none"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"variable_name": "ic-brand-Login-Content-border-color",
|
184
|
+
"type": "color",
|
185
|
+
"default": "none"
|
186
|
+
},
|
187
|
+
{
|
188
|
+
"variable_name": "ic-brand-Login-Content-inner-bgd",
|
189
|
+
"type": "color",
|
190
|
+
"default": "none"
|
191
|
+
},
|
192
|
+
{
|
193
|
+
"variable_name": "ic-brand-Login-Content-inner-border",
|
194
|
+
"type": "color",
|
195
|
+
"default": "none"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"variable_name": "ic-brand-Login-Content-inner-body-bgd",
|
199
|
+
"type": "color",
|
200
|
+
"default": "none"
|
201
|
+
},
|
202
|
+
{
|
203
|
+
"variable_name": "ic-brand-Login-Content-inner-body-border",
|
204
|
+
"type": "color",
|
205
|
+
"default": "none"
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"variable_name": "ic-brand-Login-Content-label-text-color",
|
209
|
+
"type": "color",
|
210
|
+
"default": "#ffffff"
|
211
|
+
},
|
212
|
+
{
|
213
|
+
"variable_name": "ic-brand-Login-Content-password-text-color",
|
214
|
+
"type": "color",
|
215
|
+
"default": "#ffffff"
|
216
|
+
},
|
217
|
+
{
|
218
|
+
"variable_name": "ic-brand-Login-footer-link-color",
|
219
|
+
"type": "color",
|
220
|
+
"default": "#ffffff"
|
221
|
+
},
|
222
|
+
{
|
223
|
+
"variable_name": "ic-brand-Login-footer-link-color-hover",
|
224
|
+
"type": "color",
|
225
|
+
"default": "#ffffff"
|
226
|
+
},
|
227
|
+
{
|
228
|
+
"variable_name": "ic-brand-Login-instructure-logo",
|
229
|
+
"type": "color",
|
230
|
+
"default": "#ffffff"
|
231
|
+
}
|
232
|
+
]
|
233
|
+
}]
|
@@ -0,0 +1,92 @@
|
|
1
|
+
const Fonts = [
|
2
|
+
"'Roboto', sans-serif",
|
3
|
+
"'Zilla Slab Highlight', cursive",
|
4
|
+
"'Open Sans', sans-serif",
|
5
|
+
"'Spectral', serif",
|
6
|
+
"'Slabo 27px', serif",
|
7
|
+
"'Lato', sans-serif",
|
8
|
+
"'Roboto Condensed', sans-serif",
|
9
|
+
"'Oswald', sans-serif",
|
10
|
+
"'Source Sans Pro', sans-serif",
|
11
|
+
"'Raleway', sans-serif",
|
12
|
+
"'Zilla Slab', serif",
|
13
|
+
"'Montserrat', sans-serif",
|
14
|
+
"'PT Sans', sans-serif",
|
15
|
+
"'Roboto Slab', serif",
|
16
|
+
"'Merriweather', serif",
|
17
|
+
"'Saira Condensed', sans-serif",
|
18
|
+
"'Saira', sans-serif",
|
19
|
+
"'Open Sans Condensed', sans-serif",
|
20
|
+
"'Saira Semi Condensed', sans-serif",
|
21
|
+
"'Saira Extra Condensed', sans-serif",
|
22
|
+
"'Julee', cursive",
|
23
|
+
"'Archivo', sans-serif",
|
24
|
+
"'Ubuntu', sans-serif",
|
25
|
+
"'Lora', serif",
|
26
|
+
"'Manuale', serif",
|
27
|
+
"'Asap Condensed', sans-serif",
|
28
|
+
"'Faustina', serif",
|
29
|
+
"'Cairo', sans-serif",
|
30
|
+
"'Playfair Display', serif",
|
31
|
+
"'Droid Serif', serif",
|
32
|
+
"'Noto Sans', sans-serif",
|
33
|
+
"'PT Serif', serif",
|
34
|
+
"'Droid Sans', sans-serif",
|
35
|
+
"'Arimo', sans-serif",
|
36
|
+
"'Poppins', sans-serif",
|
37
|
+
"'Sedgwick Ave Display', cursive",
|
38
|
+
"'Titillium Web', sans-serif",
|
39
|
+
"'Muli', sans-serif",
|
40
|
+
"'Sedgwick Ave', cursive",
|
41
|
+
"'Indie Flower', cursive",
|
42
|
+
"'Mada', sans-serif",
|
43
|
+
"'PT Sans Narrow', sans-serif",
|
44
|
+
"'Noto Serif', serif",
|
45
|
+
"'Bitter', serif",
|
46
|
+
"Dosis', sans-serif",
|
47
|
+
"'Josefin Sans', sans-serif",
|
48
|
+
"'Inconsolata', monospace",
|
49
|
+
"'Bowlby One SC', cursive",
|
50
|
+
"'Oxygen', sans-serif",
|
51
|
+
"'Arvo', serif",
|
52
|
+
"'Hind', sans-serif",
|
53
|
+
"'Cabin', sans-serif",
|
54
|
+
"'Fjalla One', sans-serif",
|
55
|
+
"'Anton', sans-serif",
|
56
|
+
"'Cairo', sans-serif",
|
57
|
+
"'Playfair Display', serif",
|
58
|
+
"'Droid Serif', serif",
|
59
|
+
"'Noto Sans', sans-serif",
|
60
|
+
"'PT Serif', serif",
|
61
|
+
"'Droid Sans', sans-serif",
|
62
|
+
"'Arimo', sans-serif",
|
63
|
+
"'Poppins', sans-serif",
|
64
|
+
"'Sedgwick Ave Display', cursive",
|
65
|
+
"'Titillium Web', sans-serif",
|
66
|
+
"'Muli', sans-serif",
|
67
|
+
"'Sedgwick Ave', cursive",
|
68
|
+
"'Indie Flower', cursive",
|
69
|
+
"'Mada', sans-serif",
|
70
|
+
"'PT Sans Narrow', sans-serif",
|
71
|
+
"'Noto Serif', serif",
|
72
|
+
"'Bitter', serif",
|
73
|
+
"'Dosis', sans-serif",
|
74
|
+
"'Josefin Sans', sans-serif",
|
75
|
+
"'Inconsolata', monospace",
|
76
|
+
"'Bowlby One SC', cursive",
|
77
|
+
"'Oxygen', sans-serif",
|
78
|
+
"'Arvo', serif",
|
79
|
+
"'Hind', sans-serif",
|
80
|
+
"'Nerko One', cursive",
|
81
|
+
"'Xanh Mono', monospace",
|
82
|
+
"'Texturina', serif",
|
83
|
+
"'Lobster', cursive",
|
84
|
+
"'Dancing Script', cursive",
|
85
|
+
"'Architects Daughter', cursive",
|
86
|
+
"'Modak', cursive",
|
87
|
+
"'Amatic SC', cursive"
|
88
|
+
]
|
89
|
+
|
90
|
+
export default Fonts
|
91
|
+
|
92
|
+
|
@@ -0,0 +1,130 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright (C) 2015 - present Instructure, Inc.
|
3
|
+
*
|
4
|
+
* This file is part of Canvas.
|
5
|
+
*
|
6
|
+
* Canvas is free software: you can redistribute it and/or modify it under
|
7
|
+
* the terms of the GNU Affero General Public License as published by the Free
|
8
|
+
* Software Foundation, version 3 of the License.
|
9
|
+
*
|
10
|
+
* Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
|
11
|
+
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
12
|
+
* A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
|
13
|
+
* details.
|
14
|
+
*
|
15
|
+
* You should have received a copy of the GNU Affero General Public License along
|
16
|
+
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
17
|
+
*/
|
18
|
+
|
19
|
+
import PropTypes from 'prop-types'
|
20
|
+
import _ from 'underscore'
|
21
|
+
|
22
|
+
const MD5_REGEX = /[0-9a-fA-F]{32}$/
|
23
|
+
const types = {}
|
24
|
+
|
25
|
+
types.md5 = (props, propName, componentName) => {
|
26
|
+
const val = props[propName]
|
27
|
+
if (val !== null && !MD5_REGEX.test(val)) {
|
28
|
+
return new Error(`Invalid md5: ${val} propName: ${propName} componentName: ${componentName}`)
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
const baseVarDef = {
|
33
|
+
default: PropTypes.string.isRequired,
|
34
|
+
human_name: PropTypes.string.isRequired,
|
35
|
+
variable_name: PropTypes.string.isRequired
|
36
|
+
}
|
37
|
+
|
38
|
+
types.variables = PropTypes.objectOf(PropTypes.string).isRequired
|
39
|
+
|
40
|
+
types.color = PropTypes.shape(
|
41
|
+
_.extend(
|
42
|
+
{
|
43
|
+
type: PropTypes.oneOf(['color']).isRequired
|
44
|
+
},
|
45
|
+
baseVarDef
|
46
|
+
)
|
47
|
+
)
|
48
|
+
|
49
|
+
types.fontSize = PropTypes.shape(
|
50
|
+
_.extend(
|
51
|
+
{
|
52
|
+
type: PropTypes.oneOf(['fontSize']).isRequired
|
53
|
+
},
|
54
|
+
baseVarDef
|
55
|
+
)
|
56
|
+
)
|
57
|
+
|
58
|
+
types.fontWeight = PropTypes.shape(
|
59
|
+
_.extend(
|
60
|
+
{
|
61
|
+
type: PropTypes.oneOf(['fontWeight']).isRequired
|
62
|
+
},
|
63
|
+
baseVarDef
|
64
|
+
)
|
65
|
+
)
|
66
|
+
|
67
|
+
types.fontFamily = PropTypes.shape(
|
68
|
+
_.extend(
|
69
|
+
{
|
70
|
+
type: PropTypes.oneOf(['fontFamily']).isRequired
|
71
|
+
},
|
72
|
+
baseVarDef
|
73
|
+
)
|
74
|
+
)
|
75
|
+
|
76
|
+
types.image = PropTypes.shape(
|
77
|
+
_.extend(
|
78
|
+
{
|
79
|
+
type: PropTypes.oneOf(['image']).isRequired,
|
80
|
+
accept: PropTypes.string.isRequired,
|
81
|
+
helper_text: PropTypes.string
|
82
|
+
},
|
83
|
+
baseVarDef
|
84
|
+
)
|
85
|
+
)
|
86
|
+
|
87
|
+
types.percentage = PropTypes.shape(
|
88
|
+
_.extend(
|
89
|
+
{
|
90
|
+
type: PropTypes.oneOf(['percentage']).isRequired,
|
91
|
+
helper_text: PropTypes.string
|
92
|
+
},
|
93
|
+
baseVarDef
|
94
|
+
)
|
95
|
+
)
|
96
|
+
|
97
|
+
types.varDef = PropTypes.oneOfType([types.image, types.color, types.fontFamily, types.fontSize, types.fontWeight, types.percentage])
|
98
|
+
|
99
|
+
types.brandConfig = PropTypes.shape({
|
100
|
+
md5: types.md5,
|
101
|
+
variables: types.variables
|
102
|
+
})
|
103
|
+
|
104
|
+
types.sharedBrandConfig = PropTypes.shape({
|
105
|
+
account_id: PropTypes.string,
|
106
|
+
brand_config: types.brandConfig.isRequired,
|
107
|
+
name: PropTypes.string.isRequired
|
108
|
+
})
|
109
|
+
|
110
|
+
types.variableGroup = PropTypes.shape({
|
111
|
+
group_name: PropTypes.string.isRequired,
|
112
|
+
variables: PropTypes.arrayOf(types.varDef).isRequired
|
113
|
+
})
|
114
|
+
|
115
|
+
types.userVariableInput = PropTypes.shape({
|
116
|
+
val: PropTypes.string,
|
117
|
+
invalid: PropTypes.bool
|
118
|
+
})
|
119
|
+
|
120
|
+
types.variableSchema = PropTypes.arrayOf(types.variableGroup).isRequired
|
121
|
+
|
122
|
+
types.variableDescription = PropTypes.shape({
|
123
|
+
default: PropTypes.string.isRequired,
|
124
|
+
type: PropTypes.oneOf(['color', 'fontFamily', 'fontSize', 'fontWeight', 'image', 'percentage']).isRequired,
|
125
|
+
variable_name: PropTypes.string.isRequired
|
126
|
+
})
|
127
|
+
|
128
|
+
types.brandableVariableDefaults = PropTypes.objectOf(types.variableDescription)
|
129
|
+
|
130
|
+
export default types
|