Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Position Order-Class in Custom CSS Selector #23

Open
dtcblyth opened this issue Apr 14, 2023 · 0 comments
Open

Position Order-Class in Custom CSS Selector #23

dtcblyth opened this issue Apr 14, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@dtcblyth
Copy link

Related Thread: https://discord.com/channels/1041765492907589683/1094823370895401073

Background:

In D4 the module order-class was automatically prepended to the Custom CSS selector. For example, the code below would output something like: .my_module_0 .my_heading { ... }.

$this->custom_css_fields = array(
  ...
  'my_heading' => array(
    'label'.   => esc_html__('Heading', 'my-module'),
    'selector' => '.my_heading',
  ),
  ...
),

To achieve the same result in D5 we can do something like this in the module.json file:

"customCssFields": {
  ...
  "myHeading": {
    "subName":        "myHeading",
    "selectorSuffix": " .my_heading"
  },
  ...
}

Problem:

In D4 we also had the ability to set the position of the order-class in the selector by using the %%order_class%% placeholder. Like this:

$this->custom_css_fields = array(
  ...
  'my_heading' => array(
    'label'.   => esc_html__('Heading', 'my-module'),
    'selector' => 'div%%order_class%% .my_heading',
  ),
  ...
),

As far as I know, it is not currently possible to recreate this behaviour in D5?

@dtcblyth dtcblyth added the enhancement New feature or request label Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant