-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CSS classes for text only badges to simplify common styling consistent with the Jenkins design library.
- Loading branch information
Showing
4 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
.badge-text--background { | ||
display: inline-block; | ||
border-radius: 6px; | ||
font-size: 0.75rem; | ||
font-weight: 500; | ||
padding: 0 0.4rem !important; | ||
margin: 0 0.1rem 0 0; | ||
text-decoration: none; | ||
text-align: center; | ||
white-space: nowrap; | ||
vertical-align: middle; | ||
position: relative; | ||
} | ||
|
||
.badge-text--background::before { | ||
inset: -0px -0px; | ||
border-radius: 6px; | ||
background: currentColor; | ||
opacity: .2; | ||
content: ""; | ||
position: absolute; | ||
} | ||
|
||
.badge-text--background::after { | ||
inset: -5px -0px; | ||
box-shadow: 0 0 0 10px currentColor; | ||
opacity: 0; | ||
content: ""; | ||
position: absolute; | ||
} | ||
|
||
.badge-text--bordered { | ||
display: inline-block; | ||
border: 0.1rem solid currentColor; | ||
font-size: 0.75rem; | ||
font-weight: 500; | ||
padding: 0 0.2rem !important; | ||
margin: 0 0.1rem 0 0; | ||
text-decoration: none; | ||
text-align: center; | ||
white-space: nowrap; | ||
vertical-align: middle; | ||
position: relative; | ||
} |
13 changes: 11 additions & 2 deletions
13
src/main/resources/com/jenkinsci/plugins/badge/dsl/AddBadgeStep/help-cssClass.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
<div> | ||
Optional CSS class for the badge. Classes will be applied to the enclosing <code><span></code> of a badge. | ||
User can also reference Jenkins built-in CSS classes such as <code>icon-sm</code> - see <a href="https://weekly.ci.jenkins.io/design-library">Jenkins Design Library</a> for more details. | ||
<p> | ||
Optional CSS class for the badge. Classes will be applied to the enclosing <code><span></code> of a badge. | ||
User can also reference Jenkins built-in CSS classes such as <code>icon-sm</code> - see <a href="https://weekly.ci.jenkins.io/design-library">Jenkins Design Library</a> for more details. | ||
</p> | ||
<p> | ||
This plugin includes pre-defined CSS classes for text only badges: | ||
<ul> | ||
<li><code>badge-text--background</code> - Adds colored background with rounded corners.</li> | ||
<li><code>badge-text--bordered</code> - Adds border that is the same color as the text.</li> | ||
</ul> | ||
</p> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters