Skip to content

Commit a04f7ae

Browse files
committed
pf: Make Firefox form padding consistent with other browsers
It seems Firefox fixed their longstanding bug, which caused the workaround in PatternFly (who adopted it from us) to no longer be relevant. I adjusted our own workaround, but it didn't apply as PatternFly also (at some point in time) changed the DOM so the selector no longer matched. We'll want to communicate this with PF to get PF6 fixed. Possibly even PF5 too, as it apparently changed in Firefox recently, and therefore newer versions of Firefox will "break" the expected layout without addressing it in PF directly (or with a workaround in codebases). Meanwhile, overriding the override by setting the left spacing to be the standard left spacing makes sense too. And we can just set this for Firefox-only instead of everything (which would still work, of course, but let's scope this to the scope of the issue related to the workaround).
1 parent 253d25b commit a04f7ae

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

pkg/lib/patternfly/patternfly-5-overrides.scss

+11-13
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,17 @@ to wrap around when there isn't enough space.
5353
overflow-y: auto;
5454
}
5555

56-
/* Adjust padding on form selects to resemble PF non-form selects */
57-
/* (This can be seen when the longest text is selected on a non-stretched select) */
58-
/* Upstream: https://github.com/patternfly/patternfly/issues/4387 */
59-
/* Cockpit-Podman: https://github.com/cockpit-project/cockpit-podman/issues/755 */
60-
select.pf-v5-c-form-control {
61-
--pf-v5-c-form-control--PaddingRight: 41px;
62-
--pf-v5-c-form-control--PaddingLeft: 8px;
63-
64-
// Firefox's select text has additional padding (4px)
65-
/* stylelint-disable-next-line at-rule-no-vendor-prefix */
66-
@-moz-document url-prefix() {
67-
--pf-v5-c-form-control--PaddingRight: 37px;
68-
--pf-v5-c-form-control--PaddingLeft: 4px;
56+
/* Firefox changed a padding issue that made it differ from other
57+
browsers. We no longer need the workaround, which was added to
58+
PatternFly. Therefore, we need to override it until PatternFly adapts
59+
for this change. For all browsers, it's 8px / sm. */
60+
/* New issue based on the regression based on workaround causing this issue: https://github.com/cockpit-project/cockpit/issues/21671
61+
*/
62+
/* Old upstream: https://github.com/patternfly/patternfly/issues/4387 */
63+
/* Old Cockpit-Podman: https://github.com/cockpit-project/cockpit-podman/issues/755 */
64+
@-moz-document url-prefix() {
65+
.pf-v5-c-form-control > select {
66+
--pf-v5-c-form-control--PaddingLeft: var(--pf-v5-c-form-control--inset--base);
6967
}
7068
}
7169

0 commit comments

Comments
 (0)