mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-16 19:35:14 +00:00
Fix css loading order in head (#2785)
The `custom.css` file should be loaded last to take precedence over the default file. Otherwise, the theming will not work as expected, and you would have to use `!important` most of the time.
This commit is contained in:
parent
6f07f2acf2
commit
65a93ca547
2 changed files with 19 additions and 1 deletions
|
@ -8,7 +8,6 @@
|
||||||
<meta name="theme-color" content="#65a30d" />
|
<meta name="theme-color" content="#65a30d" />
|
||||||
<title>Woodpecker</title>
|
<title>Woodpecker</title>
|
||||||
<script type="" src="/web-config.js"></script>
|
<script type="" src="/web-config.js"></script>
|
||||||
<link rel="stylesheet" href="/assets/custom.css" />
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
|
@ -25,6 +25,24 @@ function woodpeckerInfoPlugin() {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function externalCSSPlugin() {
|
||||||
|
return {
|
||||||
|
name: 'external-css',
|
||||||
|
transformIndexHtml: {
|
||||||
|
enforce: 'post',
|
||||||
|
transform() {
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
tag: 'link',
|
||||||
|
attrs: { rel: 'stylesheet', type: 'text/css', href: '/assets/custom.css' },
|
||||||
|
injectTo: 'head',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
|
@ -93,6 +111,7 @@ export default defineConfig({
|
||||||
Components({
|
Components({
|
||||||
resolvers: [IconsResolver()],
|
resolvers: [IconsResolver()],
|
||||||
}),
|
}),
|
||||||
|
externalCSSPlugin(),
|
||||||
woodpeckerInfoPlugin(),
|
woodpeckerInfoPlugin(),
|
||||||
prismjs({
|
prismjs({
|
||||||
languages: ['yaml'],
|
languages: ['yaml'],
|
||||||
|
|
Loading…
Reference in a new issue