Skip to content
Snippets Groups Projects
Commit b5069919 authored by andrii momotov's avatar andrii momotov Committed by Bohdan Minich
Browse files

Issue #3337099 by Andrii Momotov, Panchuk, boddy: Need to implement storage for the styles

parent 9ddecbef
Branches
Tags 8.x-1.0-alpha1
1 merge request!16Issue #3337099: Need to implement storage for the styles
......@@ -6,3 +6,4 @@ label: Default
float: true
allow_custom_class: false
breakpoints_provider: 'paragraphs_gridstack'
styles_list: { }
......@@ -27,3 +27,6 @@ paragraphs_gridstack.optionset.*:
breakpoints_provider:
type: string
label: "Breakpoints provider"
styles_list:
type: string
label: "Styles list"
......@@ -6,3 +6,4 @@ label: Demo
float: true
allow_custom_class: true
breakpoints_provider: paragraphs_gridstack
styles_list: { }
......@@ -63,6 +63,7 @@ use Drupal\Core\Entity\Annotation\ConfigEntityType;
* "allow_custom_class",
* "breakpoints_provider",
* "template",
* "styles_list",
* }
* )
*/
......@@ -117,4 +118,11 @@ class ParagraphsGridstack extends ConfigEntityBase {
*/
public $template;
/**
* Allows you to select a css class for an element.
*
* @var string
*/
public $styles_list;
}
......@@ -127,6 +127,18 @@ class ParagraphsGridstackFormBase extends EntityForm {
'#default_value' => $paragraphsGridstack->allow_custom_class ?? FALSE,
];
$form['styles_list'] = [
'#type' => 'textarea',
'#title' => $this->t('Styles list'),
'#default_value' => $paragraphsGridstack->styles_list ?? FALSE,
'#description' => $this->t('Enter one or more classes on each line in the format: element.classA.classB|Label.'),
'#states' => [
'visible' => [
':input[name="allow_custom_class"]' => ['checked' => TRUE],
],
],
];
// Load the list of the breakpoints providers.
// Get the default provider and validate available provider.
$options = $this->gridstackBreakpointsManager->getBreakpointsProvidersList();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment