I thought I vaguely understood how CSS works, but I seem to be missing something. I have the following html
<div id="nrdb-ui-widget-5c62f5086884aedd" class="nrdb-ui-widget nrdb-ui-gauge-classic hide-needle-2"
style="display: grid; grid-template-columns: minmax(0px, 1fr); grid-template-rows: repeat(3, minmax(var(--widget-row-height), auto)); grid-row-end: span 3; grid-column-end: span min(3, var(--layout-columns));">
<!-- Component must be wrapped in a block so props such as className and style can be passed in from parent -->
<div data-v-585800ff="" class="ui-gauge-cl-wrapper testgauge " style="grid-row-end: span 3;"><svg data-v-585800ff=""
class="cl-gauge" width="100%" height="100%" viewBox="0 0 100 100" style="--dash: 207.25784867432662;">
<g data-v-585800ff="">
<path data-v-585800ff="" class="sector" stroke-width="5"
d="M 11.090277896272866 77.24488072667465 A 47.5 47.5 0 1 1 88.90972210372712 77.24488072667468"
style="stroke-dasharray: 0 0 62.17735460229798 var(--dash); stroke: yellow;"></path>
<path data-v-585800ff="" class="sector" stroke-width="5"
d="M 11.090277896272866 77.24488072667465 A 47.5 47.5 0 1 1 88.90972210372712 77.24488072667468"
style="stroke-dasharray: 0 62.17735460229798 82.90313946973063 var(--dash); stroke: red;"></path>
<path data-v-585800ff="" class="sector" stroke-width="5"
d="M 11.090277896272866 77.24488072667465 A 47.5 47.5 0 1 1 88.90972210372712 77.24488072667468"
style="stroke-dasharray: 0 145.0804940720286 62.17735460229801 var(--dash); stroke: blue;"></path>
<path data-v-585800ff="" class="tick-minor" stroke-width="5"
d="M 11.090277896272866 77.24488072667465 A 47.5 47.5 0 1 1 88.90972210372712 77.24488072667468"
style="stroke-dasharray: 0.5, 3.64516; stroke-dashoffset: 0.25;"></path>
<path data-v-585800ff="" class="tick-major" stroke-width="5"
d="M 11.090277896272866 77.24488072667465 A 47.5 47.5 0 1 1 88.90972210372712 77.24488072667468"
style="stroke-dasharray: 1, 19.7258; stroke-dashoffset: 0.5;"></path>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: -125; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4368" _mstHash="129">0</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: -100; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4459" _mstHash="128">1</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: -75; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4550" _mstHash="127">2</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: -50; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4641" _mstHash="126">3</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: -25; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4732" _mstHash="125">4</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: 0; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4823" _mstHash="124">5</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: 25; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="4914" _mstHash="123">6</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: 50; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="5005" _mstHash="122">7</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: 75; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="5096" _mstHash="121">8</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: 100; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="5187" _mstHash="120">9</text></g>
<g data-v-585800ff="" class="num-wrap"
style="--to-x: 50; --to-y: 50; --t-r: 125; --tt-x: 50; --tt-y: 50;"><text data-v-585800ff=""
class="num" text-anchor="middle" y="-37" _mstTextHash="9451" _mstHash="119">10</text></g><text
data-v-585800ff="" class="label" y="0" x="50%" text-anchor="middle"></text><text data-v-585800ff=""
class="measurement" y="34" x="50%" text-anchor="middle" _mstTextHash="43810"
_mstHash="130">Meas</text><text data-v-585800ff="" class="units" y="61" x="50%" text-anchor="middle"
_mstTextHash="22984" _mstHash="131">°C</text><text data-v-585800ff="" class="value" y="76" x="50%"
text-anchor="middle">---</text>
</g>
<g data-v-585800ff="" class="o-needle o-needle-1"
style="transform-box: fill-box; transform-origin: 50% 100%; rotate: -140deg;">
<path d="M 50,50 48.5,50 49.85,5.280000000000001 50.15,5.280000000000001 51.5,50 z" fill="black"></path>
</g>
<g data-v-585800ff="" class="o-needle o-needle-2"
style="transform-box: fill-box; transform-origin: 50% 100%; rotate: -140deg;">
<path d="M 50,50 48.5,50 49.85,19.9 50.15,19.9 51.5,50 z" fill="brown"></path>
</g>
<g data-v-585800ff="">
<circle data-v-585800ff="" class="hub" cx="50" cy="50" r="3"></circle>
</g>
</svg></div>
</div>
This CSS successfully hides needle-2
.hide-needle-2 .o-needle-2 {
visibility: hidden;
}
hide-needle-2
is on the top line and o-needle-2
is in the 9th line up from the bottom.
However this does not hide it
.testgauge .hide-needle-2 .o-needle-2 {
visibility: hidden;
}
testgauge
appears on the 4th line from the top. What am I doing wrong please?