Page 1 of 1

Problem with css attribute selector for lang

Posted: Tue Sep 22, 2020 4:43 pm
by SNO
Hi,
When I use an CSS attribute selector like

Code: Select all

*[langcode|="de"] filter:before {
  content: "Filterkriterium: ";
}
The localized text only shows up if I enter lang="de-". If I just enter lang="de" the english text is still displayed.

Is this the correct implementation of the selector?
Explanation from https://developer.mozilla.org/en-US/doc ... _selectors

[attr|=value]
Represents elements with an attribute name of attr whose value can be exactly value or can begin with value immediately followed by a hyphen, - (U+002D). It is often used for language subcode matches.
Best regards
Stefan

Re: Problem with css attribute selector for lang

Posted: Tue Sep 22, 2020 4:51 pm
by Radu
Hi Stefan,

I tested this versus a web browser and you seem to be right, I added an internal issue to fix this. In the meantime maybe you can double the selector and add also a selector which checks for equality:

Code: Select all

*[langcode|="de"] filter:before,  *[langcode="de"] filter:before{
Regards,
Radu

Re: Problem with css attribute selector for lang

Posted: Wed Sep 23, 2020 10:00 am
by SNO
Hi Radu,
Thank you very much!

Re: Problem with css attribute selector for lang

Posted: Fri Nov 20, 2020 3:28 pm
by julien_lacour
Hello,

Starting with Oxygen 23.0 (already available on our website) you can use the "|=" in the CSS Rules.

Regards,
Julien