jenkinsci / material-theme-plugin

A Material theme plugin for Jenkins.
https://plugins.jenkins.io/material-theme/
MIT License
14 stars 16 forks source link

Adding green and yellow theme colors, formatting edits for readability & consistency #52

Closed tkensiski closed 1 year ago

tkensiski commented 2 years ago

Added a green and yellow themes Also cleaned up some unused imports and reformatted the css a bit for better readability

Issue: https://github.com/jenkinsci/material-theme-plugin/issues/53

Note I think I got everything setup for these, happy to modify as needed. The readability is subjective I understand but consistency is not so thats what I went for. Consistency was picked based on the first occurrence where each color was on its own line, this read nice and was easier to maintain in my opinion so I used that format for everywhere else. (https://github.com/jenkinsci/material-theme-plugin/blob/master/src/main/webapp/material-theme.css#L113-L116)

We needed these colors for our instances of jenkins that we previously used afonsof/jenkins-material-theme for; which this is based off of! Colors were taken from there, secondary colors are 75% opacity of the primary color.

timbrown5 commented 2 years ago

Theme picker isn't working for me locally: Screenshot 2022-09-16 at 12 00 09 Not sure why 😕

timbrown5 commented 2 years ago
diff --git a/src/main/java/io/jenkins/plugins/materialtheme/MaterialThemeRootAction.java b/src/main/java/io/jenkins/plugins/materialtheme/MaterialThemeRootAction.java
index 48e8ba6..ae9554c 100644
--- a/src/main/java/io/jenkins/plugins/materialtheme/MaterialThemeRootAction.java
+++ b/src/main/java/io/jenkins/plugins/materialtheme/MaterialThemeRootAction.java
@@ -17,6 +17,8 @@ import static io.jenkins.plugins.materialtheme.MaterialIndigoThemeManagerFactory
 import static io.jenkins.plugins.materialtheme.MaterialRedThemeManagerFactory.MATERIAL_RED_CSS;
 import static io.jenkins.plugins.materialtheme.MaterialGreyThemeManagerFactory.MATERIAL_GREY_CSS;
 import static io.jenkins.plugins.materialtheme.MaterialLightBlueThemeManagerFactory.MATERIAL_LIGHT_BLUE_CSS;
+import static io.jenkins.plugins.materialtheme.MaterialYellowThemeManagerFactory.MATERIAL_YELLOW_CSS;
+import static io.jenkins.plugins.materialtheme.MaterialGreenThemeManagerFactory.MATERIAL_GREEN_CSS;

 @Extension
 public class MaterialThemeRootAction implements UnprotectedRootAction {
@@ -41,7 +43,7 @@ public class MaterialThemeRootAction implements UnprotectedRootAction {
         if (cssFile.startsWith("/")) {
             cssFile = cssFile.substring(1);
         }
-        if (!Arrays.asList(BASE_CSS, MATERIAL_INDIGO_CSS, MATERIAL_RED_CSS, MATERIAL_GREY_CSS, MATERIAL_LIGHT_BLUE_CSS, CUSTOMISED_CSS)
+        if (!Arrays.asList(BASE_CSS, MATERIAL_INDIGO_CSS, MATERIAL_RED_CSS, MATERIAL_GREY_CSS, MATERIAL_LIGHT_BLUE_CSS, MATERIAL_YELLOW_CSS, MATERIAL_GREEN_CSS, CUSTOMISED_CSS)
                 .contains(cssFile)) {
             rsp.sendError(404);
             return;

I think you need to add your CSS files to the root action as above.

tkensiski commented 1 year ago

I think you need to add the new CSS items to the root action, see: #52 (comment)

Woops sorry about that, I think that should do it

Heres a screenshot too! Screen Shot 2022-09-20 at 5 19 54 PM

tkensiski commented 1 year ago

@timbrown5 looks like something went wrong in the release process and its not available to the jenkins plugin manager even tho github is showing the correct release version.

timbrown5 commented 1 year ago

I think a build is available, but it's got the wrong version number 0.5.2-rc100.

On Sat, 1 Oct 2022, 00:47 Trevor, @.***> wrote:

@timbrown5 https://github.com/timbrown5 looks like something went wrong in the release process and its not available to the jenkins plugin manager even tho github is showing the correct release version.

— Reply to this email directly, view it on GitHub https://github.com/jenkinsci/material-theme-plugin/pull/52#issuecomment-1264133768, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABB54FBIRVVRPZRGROWBDWLWA53YPANCNFSM6AAAAAAQNZP2NM . You are receiving this because you were mentioned.Message ID: @.***>