Skip to content

Commit

Permalink
button components - part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ropdias committed Jul 7, 2024
1 parent dae58c6 commit cd2701b
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@
<span href="#" class="btn btn-md">Label</span>
<button href="#" class="btn btn-lg">Label</button>
</div>
<div class="flex gap-1">
<a aria-label="label" href="#" class="btn btn-sm"></a>
<span aria-label="label" href="#" class="btn btn-md"></span>
<button aria-label="label" href="#" class="btn btn-lg"></button>
</div>
</body>
</html>
22 changes: 22 additions & 0 deletions src/styles/buttons.css
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,25 @@
padding: 1rem 2rem;
font-size: 1.125rem;
}

.btn[aria-label] {
position: relative;

&::before {
content: '';
position: absolute;
border-radius: inherit;
inset: 0.09375rem;
background-color: var(--bg-color);
}

&::after {
content: attr(aria-label);
background: var(--btn-bg-color);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
position: relative;
z-index: 1;
}
}

0 comments on commit cd2701b

Please sign in to comment.