For example, the following CSS:

a.question--term {
  background-color: #ff6138;
  /* setting:term_background_color */ }
  a.question--term:hover {
    background-color: #eb3000;
    /* setting:term_hover_background_color */ }

Produces the following on replacement with values #42bbea and #0073df:

a.question--term {
  background-color: #42bbea; }
  a.question--term: #0073df; }

This is due to the regex matching also the pseudo-class ":hover" part of the selector and assuming it is a replaceable property.

Comments

syastrov created an issue. See original summary.

syastrov’s picture

I have made a patch which addresses this by excluding an opening curly brace from the regex that matches the replaceable CSS properties.

lolandese’s picture

Status: Needs review » Reviewed & tested by the community

This is due to the regex matching also the pseudo-class ":hover" part of the selector and assuming it is a replaceable property.

It seems to be due to a combination with something else. If you use as below:

a.question--term {
  background-color: #ff6138; /* setting:term_background_color */
}
a.question--term:hover {
  background-color: #eb3000; /* setting:term_hover_background_color */
}

in results into:

a.question--term {
  background-color:  #ff6138;
}
a.question--term: hover {
  background-color: #eb3000;
}

Note the added space between the colon and the pseudo-class (a.question--term: hover) but also that problem gets solved by the supplied patch.

Definitely to commit.

Thanks for this improvement. Be welcome to suggest others.

lolandese’s picture

Status: Reviewed & tested by the community » Fixed

  • lolandese committed f718ff2 on 7.x-2.x authored by syastrov
    Issue #2648698 by syastrov: Value replacement clobbers CSS pseudo-class...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.