blob: 831319f5c4fce29850e119cd227636df36313c85 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="480" height="360">
<title>Style "!important" — 003</title>
<style type="text/css">
/* !important is not inherited. */
g #groupA { fill: red !important; }
use { fill: blue; }
/* Attributes cannot have !important. */
#MyRectB { fill: blue; }
/* Inline can have !important. */
#MyRectC { fill: red !important; }
/* Bad property shouldn't set !important. */
#MyRectD { fill: XXX !important; }
/* Bad inline property shouldn't set !important. */
#MyRectE { fill: blue; }
</style>
<defs>
<rect id="MyRect" width="40" height="40"/>
</defs>
<!--
<text id="title" x="240" y="50" style="fill:black; font-size:24px; text-anchor:middle;">Style "!important" — 003</text>
<a href="https://svgwg.org/svg2-draft/stylling.html">
<text id="source" x="240" y="70" style="fill:black; font-size:12px; text-anchor:middle;">https://svgwg.org/svg2-draft/styling.html</text>
</a>
-->
<g id="groupA">
<use id="MyRectA" class="classA" x="20" y="100" xlink:href="#MyRect" />
</g>
<g id="groupB">
<use id="MyRectB" class="classB" x="120" y="100" xlink:href="#MyRect" fill="red !important"/>
</g>
<g id="groupC">
<use id="MyRectC" class="classC" x="220" y="100" xlink:href="#MyRect" style="fill: blue !important"/>
</g>
<g id="groupD">
<use id="MyRectD" class="classD" x="320" y="100" xlink:href="#MyRect" style="fill: blue"/>
</g>
<g id="groupE">
<use id="MyRectE" class="classE" x="420" y="100" xlink:href="#MyRect" style="fill: XXX !important"/>
</g>
</svg>
|