TemplateStyles: Scope TemplateStyles css to main content div by adding 'mw-parser-output' [#426]

staging
gnosygnu 4 years ago
parent 7ad1291768
commit 5a35f3b05b

@ -105,7 +105,7 @@ public class Template_styles_nde implements Xox_xnde, Mwh_atr_itm_owner2 {
public static final byte Xatr__src = 0;
private static final Hash_adp_bry xatrs_hash = Hash_adp_bry.ci_a7().Add_str_byte("src", Xatr__src);
private static final Bry_fmt
html_head = Bry_fmt.Auto("\n/*TemplateStyles:r~{id}*/\n~{css}")
html_head = Bry_fmt.Auto("\n/*TemplateStyles:r~{id}*/\n.mw-parser-output ~{css}") // .mw-parser-output needs to be added to all TemplateStyles CSS, else TS ids called "portal" will affect sidebar; ISSUE#:426; PAGE:en.w:Poland DATE:2020-04-10
, html_error = Bry_fmt.Auto("<strong class=\"error\">~{msg}</strong>")
;
}

@ -59,7 +59,7 @@ public class Template_styles_nde_tst {
)
, ""
, fxt.Make__style(0, css_red)
+ fxt.Make__style(1, css_blue)
+ fxt.Make__style(1, css_blue)
);
}
@Test public void Dedupe() { // PURPOSE: multiple calls to same page should output link; DATE:2018-12-30
@ -72,7 +72,7 @@ public class Template_styles_nde_tst {
)
, ""
, String_.Concat_lines_nl
( fxt.Make__style(0, css))
( fxt.Make__style(0, css))
);
}
@Test public void Tag() { // PURPOSE: {{#tag}}
@ -131,7 +131,7 @@ class Template_styles_nde_fxt {
return ".style0{color:" + color + ";}";
}
public String Make__style(int id, String css) {
return "\n/*TemplateStyles:r" + id + "*/\n" + css;
return "\n/*TemplateStyles:r" + id + "*/\n.mw-parser-output " + css; // .mw-parser-output needs to be added to all TemplateStyles CSS, else TS ids called "portal" will affect sidebar; ISSUE#:426; PAGE:en.w:Poland DATE:2020-04-10
}
public void Test__parse(String src, String expd_html, String expd_head) {
parser_fxt.Test__parse__tmpl_to_html(src, expd_html);

Loading…
Cancel
Save