diff --git a/xExtension-ColorfulList/extension.php b/xExtension-ColorfulList/extension.php index 62121264..827d7f89 100644 --- a/xExtension-ColorfulList/extension.php +++ b/xExtension-ColorfulList/extension.php @@ -6,6 +6,7 @@ final class ColorfulListExtension extends Minz_Extension { #[\Override] public function init(): void { + Minz_View::appendStyle($this->getFileUrl('style.css')); Minz_View::appendScript($this->getFileUrl('script.js')); } } diff --git a/xExtension-ColorfulList/metadata.json b/xExtension-ColorfulList/metadata.json index f7887d7b..5267e100 100644 --- a/xExtension-ColorfulList/metadata.json +++ b/xExtension-ColorfulList/metadata.json @@ -2,7 +2,7 @@ "name": "Colorful List", "author": "Claud Xiao", "description": "Colorful Entry Title based on RSS source", - "version": "0.3.2", + "version": "0.3.3", "entrypoint": "ColorfulList", "type": "user" } diff --git a/xExtension-ColorfulList/static/script.js b/xExtension-ColorfulList/static/script.js index a7504564..cc18b6b9 100644 --- a/xExtension-ColorfulList/static/script.js +++ b/xExtension-ColorfulList/static/script.js @@ -25,7 +25,7 @@ function colorize(mList) { const entry = document.querySelectorAll('.flux_header'); entry.forEach((e, i) => { const cl = stringToColour(e.querySelector('.website').textContent) + '12'; - e.style.background = cl; + e.style.setProperty('--colorful-list-background', cl); }); } diff --git a/xExtension-ColorfulList/static/style.css b/xExtension-ColorfulList/static/style.css new file mode 100644 index 00000000..197d0a2c --- /dev/null +++ b/xExtension-ColorfulList/static/style.css @@ -0,0 +1,7 @@ +.flux_header { + background-color: var(--colorful-list-background) !important; +} + +.flux:hover .flux_header .title { + background-color: var(--colorful-list-background) !important; +}