-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide built-in css classes for text badges #201
Provide built-in css classes for text badges #201
Conversation
The functionality itself was not really „lost“ but removed intentionally. I wanted to simplify the implementation of this plugin and more importantly give users full control over the badge styling. Any „implicit styling“ was therefore removed and I’m not really convinced that restoring it is a good idea. Maybe a provocative question, but what if I actually want a text only badge without border / background? Possibly related #177 |
I was able to reproduce something with a similar effect with a bunch of css addBadge(text: "1.0.0", style: 'color: var(--green); border-radius: 5px; background: var(--light-green); padding: 0 0.4rem !important;') Users need to dig deep into css to make a simple text tag look somewhat presentable. The end user pays the cost of the plugin simplification given the same could have been accomplished before with: addShortText(text: '1.0.0', color: 'success') It appears this cost transfer was intentional so as a compromise would you be ok with bundling some default css classes that can be explicitly added rather than included by default? addBadge(text: "1.0.0", style: 'color: var(--success-color);', cssClass: 'badge-textTag') If that sounds reasonable I can rework this PR and update documentation. |
Having a set of pre-defined CSS classes sounds like a great idea. We could add those to the documentation similar to the various examples for symbols. |
Add CSS classes for text only badges to simplify common styling consistent with the Jenkins design library.
ffdf855
to
f907020
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Restores stylized text only badges lost in 2.0 refactor. Text only badges (no icon or link) will render with rounded corners and default background color that matches the text color but with some opacity.
Before:
After:
Submitter checklist