aboutsummaryrefslogtreecommitdiffstats
path: root/core/css/inputs.scss
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2023-03-31 16:50:51 +0200
committernextcloud-command <nextcloud-command@users.noreply.github.com>2023-04-17 22:25:03 +0000
commitf8d558e24f2fcbcbfa12e9681f2dc64cd9552458 (patch)
tree8667432fe62c4f5dd0906554855accef07287873 /core/css/inputs.scss
parent85c9e75f33c0c46bc33023d1f4af05f149d480c3 (diff)
downloadnextcloud-server-f8d558e24f2fcbcbfa12e9681f2dc64cd9552458.tar.gz
nextcloud-server-f8d558e24f2fcbcbfa12e9681f2dc64cd9552458.zip
fix(core): Ungroup `placeholder` css rules to prevent browsers from removing all rules
When rules are grouped using the comma operator and one selector is invalid / unknown then the whole group is invalidated[1]. In this case `::-ms-input-placeholder` is unknown to Firefox and Chrome, so the `::placeholder` rule is never applied. [1]: https://www.w3.org/TR/selectors-3/#grouping Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'core/css/inputs.scss')
-rw-r--r--core/css/inputs.scss21
1 files changed, 17 insertions, 4 deletions
diff --git a/core/css/inputs.scss b/core/css/inputs.scss
index a6eed6b31bf..5145fc782d8 100644
--- a/core/css/inputs.scss
+++ b/core/css/inputs.scss
@@ -826,9 +826,22 @@ label.infield {
overflow: hidden;
}
-::placeholder,
-::-ms-input-placeholder,
-::-webkit-input-placeholder {
+// when rules are grouped using the comma operator and one selector is invalid / unknown then the whole group is invalidated.
+// https://www.w3.org/TR/selectors-3/#grouping
+// In this case `::-ms-input-placeholder` is unknown to Firefox and Chrome
+@mixin placeholder-style {
color: var(--color-text-maxcontrast);
- font-size: var(--default-font-size);
+ font-size: var(--default-font-size);
+}
+
+::placeholder {
+ @include placeholder-style;
+}
+
+::-ms-input-placeholder {
+ @include placeholder-style;
+}
+
+::-webkit-input-placeholder {
+ @include placeholder-style;
}