Skip to content

Commit

Permalink
Add more button colors, icon style for small buttons
Browse files Browse the repository at this point in the history
Plus tag icon for the tag buttons
  • Loading branch information
raucao committed Jan 13, 2023
1 parent 138cec0 commit 1095bf0
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 14 deletions.
4 changes: 3 additions & 1 deletion app/components/expense-list/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
</p>
<p class="tags">
{{#each expense.tags as |tag|}}
<button class="small" role="none">{{tag}}</button>
<button class="small yellow" role="none">
<IconTag />{{tag}}
</button>
{{/each}}
</p>
{{#if this.showDeleteButton}}
Expand Down
47 changes: 34 additions & 13 deletions app/styles/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,32 +31,53 @@ button, input[type=submit], .button {
&.small {
font-size: 0.86rem;
padding: 0.2rem 0.8rem;

svg {
width: 1em;
height: 1em;
vertical-align: middle;
margin-right: 0.4rem;
}
}

&.danger:not(:disabled) {
color: $red;
background-color: rgba(40, 21, 21, 0.6);
border-color: rgba(40, 21, 21, 1);

&:hover {
background-color: rgba(40, 21, 21, 0.8);
}
&:focus, &:active, &.active {
border-color: $red;
}
&:hover { background-color: rgba(40, 21, 21, 0.8); }
&:focus, &:active, &.active { border-color: $red; }
}

&.green:not(:disabled) {
color: $green;
background-color: rgba(21, 40, 21, 0.6);
border-color: rgba(21, 40, 21, 1);
&:hover { background-color: rgba(21, 40, 21, 0.8); }
&:focus, &:active, &.active { border-color: $green; }
}

&:hover {
background-color: rgba(21, 40, 21, 0.8);
}
&:focus, &:active, &.active {
border-color: $green;
}
&.pink:not(:disabled) {
color: $pink;
background-color: rgba(40, 21, 40, 0.6);
border-color: rgba(40, 21, 40, 1);
&:hover { background-color: rgba(40, 21, 40, 0.8); }
&:focus, &:active, &.active { border-color: $pink; }
}

&.purple:not(:disabled) {
color: $purple;
background-color: rgba(24, 21, 40, 0.6);
border-color: rgba(24, 21, 40, 1);
&:hover { background-color: rgba(24, 21, 40, 0.8); }
&:focus, &:active, &.active { border-color: $purple; }
}

&.yellow:not(:disabled) {
color: $yellow;
background-color: rgba(40, 40, 21, 0.6);
border-color: rgba(40, 40, 21, 1);
&:hover { background-color: rgba(40, 40, 21, 0.8); }
&:focus, &:active, &.active { border-color: $yellow; }
}

&.icon {
Expand Down
1 change: 1 addition & 0 deletions app/templates/components/icon-tag.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-tag"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"></path><line x1="7" y1="7" x2="7.01" y2="7"></line></svg>

0 comments on commit 1095bf0

Please sign in to comment.