Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-73269

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

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • Jenkins LTS 2.452.1
      Badge 1.10+
      Groovy PostBuild plugin 228.vcdb_cf7265066

      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.

            bakito Marc Brugger
            jimklimov Jim Klimov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: