Skip to content

Commit 019e364

Browse files
authored
Merge pull request #8 from ubc-web-services/dev
Update theme-settings.php
2 parents 8ab79bc + b32de74 commit 019e364

File tree

1 file changed

+24
-54
lines changed

1 file changed

+24
-54
lines changed

theme-settings.php

Lines changed: 24 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -232,80 +232,50 @@ function kraken_form_system_theme_settings_alter(&$form, FormStateInterface &$fo
232232

233233
$form['unit']['clf_theme_unit_colour'] = [
234234
'#type' => 'color',
235-
'#title' => t('Unit Primary Colour (deprecated)'),
236-
'#description' => t(
237-
'This colour will be set as a variable that can be used in your css as <code>var(--color-primary)</code>.)'
238-
),
235+
'#title' => t('Unit Primary Colour'),
236+
'#description' => t('This colour will be set as a variable that can be used in your css as <code>--color-primary</code>. It is often also used as the Unit Bar Colour above.', [
237+
':url' => 'https://clf.ubc.ca/parts-of-the-clf/#unit-colors',
238+
]),
239239
'#size' => 7,
240240
'#maxlength' => 7,
241241
'#default_value' => theme_get_setting('clf_theme_unit_colour'),
242-
'#required' => true,
243-
'#disabled' => true,
244-
'#suffix' => t(
245-
'<p>Legacy Theme Primary colour is set to value: <strong>' . theme_get_setting('clf_theme_unit_colour') . '</strong>. The swatch below shows the value that will now be used in the theme. If you would like to change it, the <em>Unit Primary colour</em> should now be updated in the <a href=":url">UBC CKeditor Widgets module settings</a>. Once changed there, the primary colour setting on this page can be ignored.</p><div style="width:2rem;height:2rem;background-color:var(--color-primary);padding:2rem;border-radius:.5rem;margin: 1rem 0;"></div>', [
246-
':url' => '/admin/config/content/ubc-ckeditor-widgets',
247-
]
248-
),
242+
'#required' => TRUE,
249243
];
250244

251-
$form['unit']['clf_theme_secondary_colour'] = [
252-
'#type' => 'color',
253-
'#title' => t('Unit Secondary Colour (deprecated)'),
254-
'#description' => t(
255-
'This colour will be set as a variable that can be used in your css as <code>rgba(var(--color-secondary), 1)</code>.)', [
245+
$form['unit']['clf_theme_secondary_colour'] = [
246+
'#type' => 'color',
247+
'#title' => t('Unit Secondary Colour'),
248+
'#description' => t('This colour will be set as a variable that can be used in your css as <code>--color-secondary</code>.)', [
256249
':url' => 'https://clf.ubc.ca/parts-of-the-clf/#unit-colors',
257-
]
258-
),
259-
'#size' => 7,
260-
'#maxlength' => 7,
261-
'#default_value' => theme_get_setting('clf_theme_secondary_colour'),
262-
'#required' => true,
263-
'#disabled' => true,
264-
'#suffix' => t(
265-
'<p>Legacy Theme Secondary colour is set to value: <strong>' . theme_get_setting('clf_theme_secondary_colour') . '</strong>. The swatch below shows the value that will now be used in the theme. If you would like to change it, the <em>Unit Secondary colour</em> should now be updated in the <a href=":url">UBC CKeditor Widgets module settings</a>. Once changed there, the secondary colour setting on this page can be ignored.</p><div style="width:2rem;height:2rem;background-color:var(--color-secondary);padding:2rem;border-radius:.5rem;margin: 1rem 0;"></div>', [
266-
':url' => '/admin/config/content/ubc-ckeditor-widgets',
267-
]
268-
),
250+
]),
251+
'#size' => 7,
252+
'#maxlength' => 7,
253+
'#default_value' => theme_get_setting('clf_theme_secondary_colour'),
254+
'#required' => TRUE,
269255
];
270256

271257
$form['unit']['clf_theme_tertiary_colour'] = [
272258
'#type' => 'color',
273-
'#title' => t('Unit Tertiary Colour (deprecated)'),
274-
'#description' => t(
275-
'This colour will be set as a variable that can be used in your css as <code>rgba(var(--color-tertiary), 1)</code>.', [
276-
':url' => 'https://clf.ubc.ca/parts-of-the-clf/#unit-colors',
277-
]
278-
),
259+
'#title' => t('Unit Tertiary Colour'),
260+
'#description' => t('This colour will be set as a variable that can be used in your css as <code>--color-tertiary</code>.', [
261+
':url' => 'https://clf.ubc.ca/parts-of-the-clf/#unit-colors',
262+
]),
279263
'#size' => 7,
280264
'#maxlength' => 7,
281265
'#default_value' => theme_get_setting('clf_theme_tertiary_colour'),
282-
'#required' => true,
283-
'#disabled' => true,
284-
'#suffix' => t(
285-
'<p>Legacy Theme Tertiary colour is set to value: <strong>' . theme_get_setting('clf_theme_tertiary_colour') . '</strong>. The swatch below shows the value that will now be used in the theme. If you would like to change it, the <em>Unit Tertiary colour</em> should now be updated in the <a href=":url">UBC CKeditor Widgets module settings</a>. Once changed there, the tertiary colour setting on this page can be ignored.</p><div style="width:2rem;height:2rem;background-color:var(--color-tertiary);padding:2rem;border-radius:.5rem;margin: 1rem 0;"></div>', [
286-
':url' => '/admin/config/content/ubc-ckeditor-widgets',
287-
]
288-
),
266+
'#required' => TRUE,
289267
];
290268

291269
$form['unit']['clf_theme_accent_colour'] = [
292270
'#type' => 'color',
293-
'#title' => t('Unit Accent Colour (deprecated)'),
294-
'#description' => t(
295-
'This colour will be set as a variable that can be used in your css as <code>rgba(var(--color-accent), 1)</code>.=', [
296-
':url' => 'https://clf.ubc.ca/parts-of-the-clf/#unit-colors',
297-
]
298-
),
271+
'#title' => t('Unit Accent Colour'),
272+
'#description' => t('This colour will be set as a variable that can be used in your css as <code>--color-accent</code>.', [
273+
':url' => 'https://clf.ubc.ca/parts-of-the-clf/#unit-colors',
274+
]),
299275
'#size' => 7,
300276
'#maxlength' => 7,
301277
'#default_value' => theme_get_setting('clf_theme_accent_colour'),
302-
'#required' => true,
303-
'#disabled' => true,
304-
'#suffix' => t(
305-
'<p>Legacy Theme Accent colour is set to value: <strong>' . theme_get_setting('clf_theme_accent_colour') . '</strong>. The swatch below shows the value that will now be used in the theme. If you would like to change it, the <em>Unit Accent colour</em> should now be updated in the <a href=":url">UBC CKeditor Widgets module settings</a>. Once changed there, the accent colour setting on this page can be ignored.</p><div style="width:2rem;height:2rem;background-color:var(--color-accent);padding:2rem;border-radius:.5rem;margin: 1rem 0;"></div>', [
306-
':url' => '/admin/config/content/ubc-ckeditor-widgets',
307-
]
308-
),
278+
'#required' => TRUE,
309279
];
310280

311281
$form['unit']['clf_theme_primary_alt_colour'] = [

0 commit comments

Comments
 (0)