Extend addShortText() with ability to set a CSS style inaddition to (or even instead of) specific colors and thickness values

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      Following up from JENKINS-73167 :

      Comparing hard-coded style values of Badge 1.9.1 to Badge 1.10 which introduced CSS styles (and unfortunately lost the style contents, as pursued in that referenced issue), I think it makes sense for both Badge and Groovy PostBuild plugins to extend the possible parameters of their addShortText() methods with a new option (keeping legacy code for colors/borders intact) to set a CSS style name instead-of/additionally-to those legacy values, with the Jenkins deployment free to define such style in the custom CSS file at $JENKINS_HOME/userContent/something.css linked in controller's configuration.

      So instead of hard-coding color and thickness numbers in my call, I'd tell addShortText to, for example, add a style="badge-error" to the list of styles for the entry (built-in ones being fallback for un-customized values). There would be less HTML mark-up generated, and the site design would be more future-proof (or theme-proof) thanks to CSS.

            Assignee:
            Marc Brugger
            Reporter:
            Jim Klimov
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: