This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-fluido-skin.git

commit 00dd9cb61ba7197fd9e4a190d5ab262524ade6bd
Author: Sylwester Lachiewicz <[email protected]>
AuthorDate: Sat Oct 31 18:36:32 2026 +0000

    Link the dark theme before site.css
    
    A project's own site.css can then override it.
---
 src/it/mskins-255/verify.groovy           | 2 ++
 src/main/resources/META-INF/maven/site.vm | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/it/mskins-255/verify.groovy b/src/it/mskins-255/verify.groovy
index 5847e68..bf48ceb 100644
--- a/src/it/mskins-255/verify.groovy
+++ b/src/it/mskins-255/verify.groovy
@@ -19,6 +19,8 @@
 
 String html = new File( basedir, "target/site/index.html" ).text
 assert html.contains( '<link rel="stylesheet" href="./css/dark-theme.css" />' )
+// a project's site.css comes later and can override the dark theme
+assert html.indexOf( './css/dark-theme.css' ) < html.indexOf( './css/site.css' 
)
 
 File css = new File( basedir, "target/site/css/dark-theme.css" )
 assert css.exists()
diff --git a/src/main/resources/META-INF/maven/site.vm 
b/src/main/resources/META-INF/maven/site.vm
index c884582..5ee6846 100644
--- a/src/main/resources/META-INF/maven/site.vm
+++ b/src/main/resources/META-INF/maven/site.vm
@@ -50,11 +50,12 @@
 #end
     <title>$esc.xml( $title )</title>
     <link rel="stylesheet" 
href="$relativePath/css/[email protected][email protected]" />
-    <link rel="stylesheet" href="$relativePath/css/site.css" />
-    <link rel="stylesheet" href="$relativePath/css/print.css" media="print" />
+## before site.css, so that a project's own styles can override the dark theme
 #if( $convert.toBoolean( $site.getCustomValue( 'fluidoSkin.darkThemeEnabled', 
'false' ) ) )
     <link rel="stylesheet" href="$relativePath/css/dark-theme.css" />
 #end
+    <link rel="stylesheet" href="$relativePath/css/site.css" />
+    <link rel="stylesheet" href="$relativePath/css/print.css" media="print" />
 #**##prjProfile()
     <script 
src="$relativePath/js/[email protected][email protected]"></script>
 #**##if( $site.body.head )

Reply via email to