Account created on 24 December 2015, almost 9 years ago
#

Merge Requests

Recent comments

πŸ‡«πŸ‡·France ccrosaz

ccrosaz β†’ made their first commit to this issue’s fork.

πŸ‡«πŸ‡·France ccrosaz

After applying the patch :

FILE: style_options/css/horizontal-tabs.css
-----------------------------------------------------------------------------------------------------
FOUND 8 ERRORS AFFECTING 7 LINES
-----------------------------------------------------------------------------------------------------
8 | ERROR | [x] Selectors must be on a single line
9 | ERROR | [x] Blank lines are not allowed between class names
10 | ERROR | [ ] Style definitions must end with a semicolon
19 | ERROR | [x] Selectors must be on a single line
20 | ERROR | [x] Blank lines are not allowed between class names
21 | ERROR | [ ] Style definitions must end with a semicolon
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
33 | ERROR | [ ] No style definition found on line; check for missing colon
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

πŸ‡«πŸ‡·France ccrosaz

FILE: style_options/css/horizontal-tabs.css
-----------------------------------------------------------------------------------------------------
FOUND 43 ERRORS AFFECTING 27 LINES
-----------------------------------------------------------------------------------------------------
2 | ERROR | [x] Selectors must be on a single line
3 | ERROR | [x] Selectors must be on a single line
4 | ERROR | [x] Selectors must be on a single line
5 | ERROR | [x] Selectors must be on a single line
6 | ERROR | [x] Selectors must be on a single line
7 | ERROR | [x] Selectors must be on a single line
8 | ERROR | [x] Selectors must be on a single line
9 | ERROR | [ ] Style definitions must end with a semicolon
18 | ERROR | [x] Selectors must be on a single line
19 | ERROR | [x] Blank lines are not allowed between class names
20 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
20 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
20 | ERROR | [ ] Style definitions must end with a semicolon
21 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
21 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
22 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
22 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
23 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
23 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
24 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
25 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
25 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
26 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
26 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
27 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
27 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
28 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
28 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
30 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
30 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
32 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
32 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
33 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
33 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
34 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 7
34 | ERROR | [ ] No style definition found on line; check for missing colon
35 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
35 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
36 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 5
37 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
37 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 2
38 | ERROR | [x] Spaces must be used to indent lines; tabs are not allowed
38 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 1
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 40 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------

πŸ‡«πŸ‡·France ccrosaz

$ phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml style_options/

FILE: style_options/src/Contracts/StyleOptionPluginInterface.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Plugin\ConfigurableInterface.
---------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/Plugin/Layout/StyleOptionLayoutPlugin.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
7 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/Plugin/paragraphs/Behavior/StyleOptionBehavior.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/Plugin/StyleOption/BackgroundColor.php
-------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------
9 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\style_options\Plugin\StyleOptionPluginBase.
-------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/Plugin/StyleOption/BackgroundImage.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Render\Renderer.
------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/Plugin/StyleOptionPluginBase.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Plugin\PluginBase.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/StyleOptionConfigurationDiscovery.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\NestedArray.
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/StyleOptionPluginManager.php
---------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------------
8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Cache\CacheBackendInterface.
---------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------

FILE: style_options/src/StyleOptionStyleTrait.php
-----------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------
6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Utility\Html.
-----------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------

FILE: style_options/style_options.module
--------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
--------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------

πŸ‡«πŸ‡·France ccrosaz

I think the Behaviors details container is not proposed by the style_options module but is part of the paragraphs plugin behaviors.
You must also have activate layout_paragraphs module, which allow you to define and translate the title of the section Behaviors.

The 'Layout Options' details only shows options defined directly to apply to layout in your the XXX.style_options.yml files, and is managed by the layout core functionality.

Both layout and paragraphs behaviors cannot be handle together.

πŸ‡«πŸ‡·France ccrosaz

As describe in the project page, this module do not provide any default plugin configuration:

Style Options is a developer module and does not provide an admin interface. Once the module is installed, developers can create configuration files in modules or themes, named [module name].style_options.yml or [theme name].style_options.yml, in the root folder of either a module or theme, respectively. See examlpe.style_options.yml for an overview of possible configuration.

You have to define your own XXX.style_option.yml file in a custom module or theme on your project.

πŸ‡«πŸ‡·France ccrosaz

It is not really clear in the documentation or the example.style_options.yml, but you can use keyed option array for your values, and it solve different problems :

  • You can modify the order of the values
  • You can add and delete values
  • You can define a default value more specifically

In your example, you can use something like:

options:
  margin_bottom:
    plugin: css_class
    label: 'Außenabstand unten'
    multiple: false
    required: true
    options:
      nomargin:
        label: No margin
        class: mb-0
      small:
        label: Small Margin
        class: 'mb-2 md:mb-4 xl:mb-8'
      medium:
        label: Medium Margin
        class: 'mb-4 md:mb-8 xl:mb-16'
      large:
        label: Big margin
        class: 'mb-8 md:mb-16 xl:mb-32'
    default: medium
πŸ‡«πŸ‡·France ccrosaz

I finally give it a try, and I saw that the way it's implemented in LayoutPluginManager is different and cannot work with the multi yml files of style_options.

I think the solution I proposed to apply it on the contruction of the StyleOptionPluginBase is more efficient. Let me know what you think.

Production build 0.71.5 2024