Skip to content

Commit

Permalink
feat: add badge component
Browse files Browse the repository at this point in the history
  • Loading branch information
matifandy8 committed Oct 20, 2023
1 parent 4bc509d commit 6f6d511
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 3 deletions.
20 changes: 20 additions & 0 deletions dist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -680,3 +680,23 @@ input.nb-checkbox {
top: 0px;
font-size: 18px;
text-align: center; }

.badge {
width: fit-content;
padding: 5px;
border: 2px solid #000;
border-radius: 50px;
background-color: #40d39c;
box-shadow: 3px 3px 0 0 #000; }
.badge .badge-inner {
display: flex;
height: 100%;
margin: 0;
justify-content: center;
align-items: center;
border: 2px solid #000;
border-radius: 50px; }
.badge .badge-inner .badge-text {
color: #031926;
padding: 10px;
margin: 0; }
2 changes: 1 addition & 1 deletion dist/index.min.css

Large diffs are not rendered by default.

28 changes: 27 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<link rel="icon" sizes="32x32" href="assets/logo.png" type="image/x-icon">
<link rel="icon" sizes="16x16" href="assets/logo.png" type="image/x-icon">
<link rel="icon" href="assets/logo.png" type="image/x-icon">
<link rel="stylesheet" href="https://unpkg.com/neobrutalismcss@latest">
<!-- <link rel="stylesheet" href="https://unpkg.com/neobrutalismcss@latest"> -->
<!-- for dev -->
<link rel="stylesheet" href="/dist/index.css" />
<!-- -->
Expand Down Expand Up @@ -251,6 +251,32 @@ <h3>Card</h3>
</code>
</pre>
</figure>
</section>
<section class="sections">
<h3>Badge</h3>
<p class="component-description">
Section presents a badge with text. It illustrates a user interface component
provided by NeoBrutalismCSS for badges.
</p>
<div class="badge">
<div class="badge-inner">
<p class="badge-text">Excellence</p>
</div>
</div>
<figure class="highlight">
<pre>
<button class="copy tooltip copy-button"><img src="assets/copy.svg" alt="copy"> <span class="tooltiptext">Copy to clipboard</span></button>
<code class="language-html" data-lang="html">
<span class="tag">&lt;div</span> <span class="class">class=</span><span class="name">"badge"</span><span class="tag">&gt;</span>
<span class="tag">&lt;div</span> <span class="class">class=</span><span class="name">"badge-inner"</span><span class="tag">&gt;</span>
<span class="tag">&lt;p</span> <span class="class">class=</span><span class="name">"badge-text"</span><span class="tag">&gt;</span>Excellence<span class="tag">&lt;/p&gt;</span>
<span class="tag">&lt;/div&gt;</span>
<span class="tag">&lt;/div&gt;</span>
</code>
</pre>
</figure>


</section>
<section class="sections">
<h3>Dialog</h3>
Expand Down
1 change: 1 addition & 0 deletions docs/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ h2 {
font-family: "Lexend Mega", sans-serif;
line-height: 2rem;
}

h3 {
font-family: "Lexend Mega", sans-serif;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neobrutalismcss",
"version": "0.1.2",
"version": "0.1.3",
"description": "NeoBrutalismCSS design framework that embraces the aesthetics of neo-brutalism in web",
"main": "dist/index.min.css",
"repository": {
Expand Down
23 changes: 23 additions & 0 deletions src/scss/components/_badge.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.badge {
width: fit-content;
padding: 5px;
border: 2px solid #000;
border-radius: 50px;
background-color: #40d39c;
box-shadow: 3px 3px 0 0 #000;

.badge-inner {
display: flex;
height: 100%;
margin: 0;
justify-content: center;
align-items: center;
border: 2px solid #000;
border-radius: 50px;
.badge-text {
color: #031926;
padding: 10px;
margin: 0;
}
}
}
1 change: 1 addition & 0 deletions src/scss/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
@import "components/cards";
@import "components/avatar";
@import "components/checkbox";
@import "components/badge";

0 comments on commit 6f6d511

Please sign in to comment.