jenkinsci / dark-theme-plugin

Jenkins Dark Theme
https://plugins.jenkins.io/dark-theme/
MIT License
70 stars 37 forks source link

CSS URLs for Simple Theme Plugin not working #412

Closed LoganBarnett closed 11 months ago

LoganBarnett commented 11 months ago

Describe your use-case which is not covered by existing documentation.

Hi folks,

I'm trying to get this theme consumed via the Simple Theme Plugin's CSS URL configuration per the documentation for this theme.

Here is the URL the README provides:

https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@<tag-name>/src/main/resources/io/jenkins/plugins/darktheme/theme.css

Using the current tag name (verbatim), I reckon this URL:

https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@372.v79b_02c754b_29/src/main/resources/io/jenkins/plugins/darktheme/theme.css

But this results in a 404. See the curl:

$ curl -s https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@372.v79b_02c754b_29/src/main/resources/io/jenkins/plugins/darktheme/theme.css

Couldn't find the requested file /src/main/resources/io/jenkins/plugins/darktheme/theme.css in jenkinsci/dark-theme.

I've tried some other variants, thinking maybe I'm reading things too literally or not literally enough:

https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@<372.v79b_02c754b_29>/src/main/resources/io/jenkins/plugins/darktheme/theme.css
https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@372/src/main/resources/io/jenkins/plugins/darktheme/theme.css
(older version)
https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@359.vb_d6175e5f6f9/src/main/resources/io/jenkins/plugins/darktheme/theme.css

I searched around the issues to find older tags, but those don't seem to work either. They also look dramatically different, tag-wise.

If I do try latest for <tag-name>, it works:

$ curl -s https://cdn.jsdelivr.net/gh/jenkinsci/dark-theme@latest/src/main/resources/io/jenkins/plugins/darktheme/theme.css | head -n 5

:root {
  --dark-theme-bg-black: #111;
  --dark-theme-bg-dark: #222;
  --dark-theme-bg-medium: #2d2b2b;
  --dark-theme-bg-dark-grey: #333;

I imagine I'm missing something relatively obvious. My request here is twofold:

  1. What should the URL be for a fixed tag of the latest version?
  2. Would you be amenable to a pull request which would add such an example?

Apologies if I missed something really, really simple here.

Thanks for maintaining this theme! It spares my eyes the sensation of staring into a burning hot star.

Reference any relevant documentation, other materials or issues/pull requests that can be used for inspiration.

No response

timja commented 11 months ago

Hi, thanks for the report.

This hasn't worked since we switched to using the sass pre-processor. The simple theme plugin gives a poorer user experience as you need to maintain the version yourself, while the plugin version of this will stay compatible with newer versions of Jenkins and will correctly give you the version you need for the version of Jenkins.

Yes old tags won't work as both Jenkins CSS and this plugin have gone through many revisions, the Jenkins plugin manager will ensure that you get compatible versions.

The simple theme plugin approach was more for when this plugin was created initially and I don't think it's worth it now.

If you really need to use the simple theme plugin approach you can build the sass yourself with https://sass-lang.com/dart-sass/ and then host it somewhere.