modern-normalize icon indicating copy to clipboard operation
modern-normalize copied to clipboard

Remove `optgroup` element

Open cevdetta opened this issue 1 year ago • 4 comments

In modern-normalize.css file, there is a reset for form elements:

/**
1. Change the font styles in all browsers.
2. Remove the margin in Firefox and Safari.
*/

button,
input,
optgroup,
select,
textarea {
	font-family: inherit; /* 1 */
	font-size: 100%; /* 1 */
	line-height: 1.15; /* 1 */
	margin: 0; /* 2 */
}

button, input, selectandtextareaseem fine butoptgroupis unnecessary; why you may ask, becauseoptgroupshould be a child element ofselectandoptgroupshould be a parent element ofoptionelement, we can remove it to take advantage of cascading whichselect` element does when it inherits.

cevdetta avatar Oct 15 '24 22:10 cevdetta

Relevant: https://github.com/necolas/normalize.css/issues/581

sindresorhus avatar Oct 16 '24 09:10 sindresorhus

Relevant: necolas/normalize.css#581

The font family and font style are not inherited by optgroup labels and options within an optgroup in Firefox 45 (probably happens in some older versions too). The screenshot below demonstrates this using the normalize.css UI tests page:

Firefox 45? https://caniuse.com/usage-table From version 2 - 45, only 0,02% of people are using it, so it's really unnecessary? In my opinion it should be deleted, we have more problems than that (which is a bug in Firefox 45, it's so small).

11: 0.01%
44: 0.01%

cevdetta avatar Oct 16 '24 15:10 cevdetta

Firefox 45 was the latest then. It's not clear if or when it was fixed. It needs to be proven that it was fixed first.

sindresorhus avatar Oct 16 '24 19:10 sindresorhus

Firefox 45 was the latest then. It's not clear if or when it was fixed. It needs to be proven that it was fixed first.

Got it but still if you look https://caniuse.com/usage-table

11: 0.01%
44: 0.01%
52: 0.04%
54: 0.01%
56: 0.02%
78: 0.01%
88: 0.01%
---
102: 0.01%
103: 0.01%
113: 0.01%
115: 0.35%
117: 0.01%
118: 0.09%
120: 0.01%
121: 0.01%
123: 0.01%
124: 0.01%
125: 0.01%
126: 0.03%
127: 0.04%
128: 0.45%
129: 1.09%
130: 0.01%

Even before Firefox v100 the usage is only 0.11% which I might say even IE usage is 0.59% ? The thing is I don't know how to prove if it's fixed after v45 or not...

cevdetta avatar Oct 16 '24 19:10 cevdetta