diff --git a/3rdparty b/3rdparty index 178ffea6b4c68..d8d85fb532f5d 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 178ffea6b4c68f951e31df600f8929ee5466fd62 +Subproject commit d8d85fb532f5de016608f2572a1587f3d9894853 diff --git a/apps/theming/lib/Controller/ThemingController.php b/apps/theming/lib/Controller/ThemingController.php index 94deb2e73768b..f05edd503701e 100644 --- a/apps/theming/lib/Controller/ThemingController.php +++ b/apps/theming/lib/Controller/ThemingController.php @@ -55,7 +55,6 @@ use OCP\IRequest; use OCP\ITempManager; use OCP\IURLGenerator; -use ScssPhp\ScssPhp\Compiler; /** * Class ThemingController @@ -317,7 +316,7 @@ public function getThemeStylesheet(string $themeId, bool $plain = false, bool $w } $theme = $themes[$themeId]; - $customCss = $theme->getCustomCss(); + $customCss = $theme->getCustomCss("body[data-theme-$themeId]"); // Generate variables $variables = ''; @@ -330,9 +329,7 @@ public function getThemeStylesheet(string $themeId, bool $plain = false, bool $w $css = ":root { $variables } " . $customCss; } else { // If not set, we'll rely on the body class - $compiler = new Compiler(); - $compiledCss = $compiler->compileString("body[data-theme-$themeId] { $variables $customCss }"); - $css = $compiledCss->getCss();; + $css = "body[data-theme-$themeId] { $variables } " . $customCss ; } try { diff --git a/apps/theming/lib/ITheme.php b/apps/theming/lib/ITheme.php index a5c9cdf26a623..82c4d2008bc38 100644 --- a/apps/theming/lib/ITheme.php +++ b/apps/theming/lib/ITheme.php @@ -92,8 +92,9 @@ public function getCSSVariables(): array; * ⚠️ Warning, should be used slightly. * Theoretically, editing the variables should be enough. * + * @param string $prefix The css prefix for every rule. It should be appended before every rule. * @return string * @since 25.0.0 */ - public function getCustomCss(): string; + public function getCustomCss(string $prefix): string; } diff --git a/apps/theming/lib/Themes/DarkHighContrastTheme.php b/apps/theming/lib/Themes/DarkHighContrastTheme.php index 62b7d4f6358ba..1f8fb126f2b03 100644 --- a/apps/theming/lib/Themes/DarkHighContrastTheme.php +++ b/apps/theming/lib/Themes/DarkHighContrastTheme.php @@ -85,12 +85,12 @@ public function getCSSVariables(): array { return $variables; } - public function getCustomCss(): string { + public function getCustomCss(string $prefix): string { return " - [class^='icon-'], [class*=' icon-'], - .action, - #appmenu li a, - .menutoggle { + $prefix [class^='icon-'], $prefix [class*=' icon-'], + $prefix .action, + $prefix #appmenu li a, + $prefix .menutoggle { opacity: 1 !important; } "; diff --git a/apps/theming/lib/Themes/DefaultTheme.php b/apps/theming/lib/Themes/DefaultTheme.php index 58983d29df132..e31cc353470f7 100644 --- a/apps/theming/lib/Themes/DefaultTheme.php +++ b/apps/theming/lib/Themes/DefaultTheme.php @@ -209,7 +209,7 @@ public function getCSSVariables(): array { return $variables; } - public function getCustomCss(): string { + public function getCustomCss(string $prefix): string { return ''; } } diff --git a/apps/theming/lib/Themes/DyslexiaFont.php b/apps/theming/lib/Themes/DyslexiaFont.php index 2629ac588c621..093b07005675b 100644 --- a/apps/theming/lib/Themes/DyslexiaFont.php +++ b/apps/theming/lib/Themes/DyslexiaFont.php @@ -59,7 +59,7 @@ public function getCSSVariables(): array { return $variables; } - public function getCustomCss(): string { + public function getCustomCss(string $prefix): string { $fontPathWoff = $this->urlGenerator->linkTo('theming', 'fonts/OpenDyslexic-Regular.woff'); $fontPathOtf = $this->urlGenerator->linkTo('theming', 'fonts/OpenDyslexic-Regular.otf'); $fontPathTtf = $this->urlGenerator->linkTo('theming', 'fonts/OpenDyslexic-Regular.ttf'); diff --git a/apps/theming/lib/Themes/HighContrastTheme.php b/apps/theming/lib/Themes/HighContrastTheme.php index 77239f2076c24..f55efc3a66510 100644 --- a/apps/theming/lib/Themes/HighContrastTheme.php +++ b/apps/theming/lib/Themes/HighContrastTheme.php @@ -78,12 +78,12 @@ public function getCSSVariables(): array { return $variables; } - public function getCustomCss(): string { + public function getCustomCss(string $prefix): string { return " - [class^='icon-'], [class*=' icon-'], - .action, - #appmenu li a, - .menutoggle { + $prefix [class^='icon-'], $prefix [class*=' icon-'], + $prefix .action, + $prefix #appmenu li a, + $prefix .menutoggle { opacity: 1 !important; } ";