Topic on Extension talk:TemplateStyles

Errors Due To Sanitation?

4
Summary by Tgr (WMF)

var() is not supported since it's basically impossible to sanitize.

Johnywhy (talkcontribs)

i tried to create page Template:Tag/Tag.css.

I entered CSS that works with no problem in MediaWiki:Common.css

But when i save the page, i get:

Unrecognized or unsupported property at line 4 character 3.
Unrecognized or unsupported property at line 6 character 3.
Invalid or unsupported value for property top at line 12 character 8.
Invalid or unsupported value for property left at line 13 character 9.
Invalid or unsupported value for property bottom at line 14 character 11.
Invalid or unsupported value for property right at line 15 character 10.
Invalid or unsupported value for property padding-top at line 37 character 18.
Invalid or unsupported value for property padding-bottom at line 38 character 21.

Is that due to Sanitation?

Anomie (talkcontribs)

The sanitization does not allow some properties because they're unsafe, and it's possible it doesn't recognize some vendor properties (see T162379 about that) or hacks. It also won't allow invalid values, since to sanitize it has to first recognize them.

Without knowing what exactly you're trying, I can't say more than that.

Johnywhy (talkcontribs)
:root { 
  /* constants */
  --hotpad: -2em;
  --linepad: .4em
}

.tag-label a::before {
  display: block;
  position: absolute;  
  top: var(--hotpad);
  left: var(--hotpad);
  bottom: var(--hotpad);
  right: var(--hotpad);
  content: ''; 
}

.tag-label {
  position: relative;
}

.tag-label a {
  color: Green;
  font-weight: bold;
}

.tag-label:hover + .tag-region:not(:hover) {
     background-color:#ffe999;
     padding-top:var(--linepad);
     padding-bottom:var(--linepad);
}
Anomie (talkcontribs)

var() is not supported since it's basically impossible to sanitize.