Skip to content

Commit

Permalink
feat: special button styles and variables (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesaroeduardo authored Nov 13, 2024
1 parent 8a49314 commit a518a0d
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/azion-dark/_custom.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import './custom/selection'
@import './custom/selection';
@import './custom/special-button';
56 changes: 56 additions & 0 deletions src/azion-dark/custom/_special-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.special-button {
position: relative;
display: flex;
justify-content: center;
align-items: center;
border: none;
padding: 1px;
background-color: transparent;
border-radius: 0.375rem;
overflow: hidden;
transition: background-color 0.3s ease;

&::before {
content: '';
position: absolute;
inset: 0;
filter: blur(12px);
background: linear-gradient(
90deg,
rgba(255, 255, 255, 1), /* white */
rgba(0, 20, 255, 1), /* violet */
rgba(255, 120, 0, 1) /* orange */
);
animation: rotate-background 8s linear infinite;
z-index: 1;
pointer-events: none;
}

&:hover .special-button-content {
background-color: var(--special-button-hover-bg);
box-shadow: inset 0 0 0 0px var(--surface-border);
}
}

.special-button-content {
position: relative;
z-index: 2;
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0 0.75rem;
height: 2rem;
border-radius: 0.375rem;
background-color: var(--special-button-bg);
transition: background-color 0.3s ease;
box-shadow: inset 0 0 0 .5px var(--surface-border);
}

@keyframes rotate-background {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
3 changes: 2 additions & 1 deletion src/azion-light/_custom.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import './custom/selection'
@import './custom/selection';
@import './custom/special-button';
56 changes: 56 additions & 0 deletions src/azion-light/custom/_special-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.special-button {
position: relative;
display: flex;
justify-content: center;
align-items: center;
border: none;
padding: 1px;
background-color: transparent;
border-radius: 0.375rem;
overflow: hidden;
transition: background-color 0.3s ease;

&::before {
content: '';
position: absolute;
inset: 0;
filter: blur(12px);
background: linear-gradient(
90deg,
rgba(255, 255, 255, 1), /* white */
rgba(0, 20, 255, 1), /* violet */
rgba(255, 120, 0, 1) /* orange */
);
animation: rotate-background 8s linear infinite;
z-index: 1;
pointer-events: none;
}

&:hover .special-button-content {
background-color: var(--special-button-hover-bg);
box-shadow: inset 0 0 0 0px var(--surface-border);
}
}

.special-button-content {
position: relative;
z-index: 2;
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0 0.75rem;
height: 2rem;
border-radius: 0.375rem;
background-color: var(--special-button-bg);
transition: background-color 0.3s ease;
box-shadow: inset 0 0 0 .5px var(--surface-border);
}

@keyframes rotate-background {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
3 changes: 2 additions & 1 deletion src/azion/_custom.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import './custom/selection'
@import './custom/selection';
@import './custom/special-button';
4 changes: 4 additions & 0 deletions src/azion/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ $colors: (
--carousel-indicator: #e9ecef20;
--carousel-indicator-highlight: #ededed;
--carousel-indicator-hover: #dee2e640;
--special-button-bg: rgba(23, 23, 23, 0.85);
--special-button-hover-bg: rgba(23, 23, 23, 0.25);
}

:root.azion.azion-light {
Expand Down Expand Up @@ -387,4 +389,6 @@ $colors: (
--carousel-indicator: #e9ecef;
--carousel-indicator-highlight: #1c1c1c;
--carousel-indicator-hover: #dee2e6;
--special-button-bg: rgba(255, 255, 255);
--special-button-hover-bg: rgba(255, 255, 255, 0.85);
}
57 changes: 57 additions & 0 deletions src/azion/custom/_special-button.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
.special-button {
position: relative;
display: flex;
justify-content: center;
align-items: center;
border: none;
padding: 1px;
background-color: transparent;
border-radius: 0.375rem;
overflow: hidden;
transition: background-color 0.3s ease;

&::before {
content: '';
position: absolute;
inset: 0;
filter: blur(12px);
background: linear-gradient(
90deg,
rgba(255, 255, 255, 1), /* white */
rgba(0, 20, 255, 1), /* violet */
rgba(255, 120, 0, 1) /* orange */
);
animation: rotate-background 8s linear infinite;
z-index: 1;
pointer-events: none;
}

&:hover .special-button-content {
background-color: var(--special-button-hover-bg);
box-shadow: inset 0 0 0 0px var(--surface-border);
}
}

.special-button-content {
position: relative;
z-index: 2;
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0 0.75rem;
height: 2rem;
border-radius: 0.375rem;
background-color: var(--special-button-bg);
transition: background-color 0.3s ease;
box-shadow: inset 0 0 0 .5px var(--surface-border);
}

@keyframes rotate-background {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

0 comments on commit a518a0d

Please sign in to comment.