Skip to content
Snippets Groups Projects
Commit 1b3fa359 authored by Florent Torregrosa's avatar Florent Torregrosa Committed by Florent Torregrosa
Browse files

Issue #3318405 by Grimreaper: Fix config schema. Remove unneeded dependencies....

Issue #3318405 by Grimreaper: Fix config schema. Remove unneeded dependencies. Fix coding standards.
parent e0597842
No related branches found
No related tags found
1 merge request!24Issue #3318405: CSS Variables: UI Skins integration
ui_suite_bootstrap.settings:
type: theme_settings
label: 'UI Suite Bootstrap settings'
......@@ -9,6 +9,16 @@ namespace Drupal\ui_suite_bootstrap\HookHandler;
*/
class PreprocessPatternCard {
/**
* Length of the word tabs.
*/
public const TABS_LENGTH = 4;
/**
* Length of the word pills.
*/
public const PILLS_LENGTH = 5;
/**
* Handle CSS classes.
*
......@@ -97,10 +107,10 @@ class PreprocessPatternCard {
if (\array_key_exists('#id', $item) && \array_key_exists('#variant', $item)) {
if ($item['#id'] === 'nav') {
if (substr($item['#variant'], 0, 4) === 'tabs') {
if (\substr($item['#variant'], 0, static::TABS_LENGTH) === 'tabs') {
$item['#attributes']['class'][] = 'card-header-tabs';
}
elseif (substr($item['#variant'], 0, 5) === 'pills') {
elseif (\substr($item['#variant'], 0, static::PILLS_LENGTH) === 'pills') {
$item['#attributes']['class'][] = 'card-header-pills';
}
}
......
......@@ -49,7 +49,7 @@ class PreprocessPatternNavItem {
]);
}
if (array_key_exists('link', $variables)) {
if (\array_key_exists('link', $variables)) {
if (isset($variables['link']) && !empty($variables['link'])) {
if (!($variables['link']['#url'] instanceof Url)) {
$variables['link']['#url'] = Url::fromUri($variables['link']['#url']);
......@@ -62,4 +62,5 @@ class PreprocessPatternNavItem {
}
}
}
}
......@@ -5,8 +5,6 @@ core_version_requirement: ^9 || ^10
base theme: false
dependencies:
- layout_options:layout_options
- ui_examples:ui_examples
- ui_patterns:ui_patterns
- ui_patterns:ui_patterns_library
- ui_patterns_settings:ui_patterns_settings
- ui_styles:ui_styles
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment