components/sass/button/_index.scss

116 lines
3.2 KiB
SCSS
Raw Permalink Normal View History

2018-11-29 00:36:23 +01:00
.button {
fill: currentColor;
position: relative;
2019-03-05 22:02:41 +01:00
white-space: nowrap;
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--alt {
&:hover {
text-decoration: underline;
2018-11-29 00:36:23 +01:00
}
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--constrict {
@include constrict(20vw);
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--disabled {
opacity: 0.3;
&:not([disabled]) {
pointer-events: none;
&:hover {
background-color: inherit;
color: inherit;
fill: inherit;
}
}
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--icon {
2019-10-25 19:36:41 +02:00
width: 5rem;
height: 5rem;
background-color: rgba($lbry-black, 0.7);
2018-12-06 18:48:18 +01:00
background-repeat: no-repeat;
background-size: 50%;
border-radius: 50%;
color: var(--lbry-white);
2018-12-06 18:48:18 +01:00
transition: background-color 0.2s;
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
&:hover {
background-color: var(--lbry-green-3);
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
&.button--play {
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cg stroke='white' stroke-width='2' fill='white' fill-rule='evenodd' stroke-linejoin='round'%3E %3Cpolygon points='5 21 5 3 21 12'/%3E %3C/g%3E %3C/svg%3E");
background-position: calc(50% + 0.1rem) center;
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
&.button--view {
background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E %3Cg stroke='white' stroke-width='2' fill='none' fill-rule='evenodd'%3E %3Cpath d='M2, 12 C2, 12 5, 5 12, 5 C19, 5 22, 12 22, 12 C22, 12 19, 19 12, 19 C5, 19 2, 12 2, 12 Z' stroke-linejoin='round'/%3E %3Ccircle cx='12' cy='12' r='3'/%3E %3Cpath d='M12, 5 L12, 3' stroke-linecap='round'/%3E %3Cpath d='M18, 6.5 L19, 5' stroke-linecap='round'/%3E %3Cpath d='M21, 10 L22.5, 9' stroke-linecap='round'/%3E %3Cpath d='M1.5, 10 L3, 9' stroke-linecap='round' transform='translate(2.250000, 9.500000) scale(1, -1) translate(-2.250000, -9.500000)'/%3E %3Cpath d='M5, 6.5 L6, 5' stroke-linecap='round' transform='translate(5.500000, 5.750000) scale(-1, 1) translate(-5.500000, -5.750000)'/%3E %3C/g%3E %3C/svg%3E");
background-position: center calc(50% + 0.1rem);
2018-11-29 00:36:23 +01:00
}
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--inverse {
2019-01-08 23:57:04 +01:00
padding: var(--spacing-xs) var(--spacing-s); // sass-lint:disable-line shorthand-values
2019-10-25 19:36:41 +02:00
background-color: transparent;
border: 1px solid var(--lbry-gray-1);
2018-12-06 18:48:18 +01:00
border-radius: 1rem;
color: inherit;
transition: background-color 0.2s;
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
[data-mode="dark"] & {
border-color: rgba($lbry-white, 0.1);
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
&:hover {
background-color: var(--lbry-gray-1);
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
[data-mode="dark"] & {
background-color: rgba($lbry-white, 0.1);
2018-11-29 00:36:23 +01:00
}
}
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--link {
color: var(--lbry-teal-5);
2018-12-06 18:48:18 +01:00
transition: color 0.2s;
2019-03-09 00:30:24 +01:00
word-break: break-all;
2018-11-29 00:36:23 +01:00
2019-03-09 00:30:24 +01:00
[data-mode="dark"] & {
color: var(--lbry-teal-3);
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2019-03-09 00:30:24 +01:00
&:hover {
color: var(--lbry-teal-3);
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
[data-mode="dark"] & {
color: var(--lbry-teal-4);
2018-11-29 00:36:23 +01:00
}
}
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--primary {
2019-01-08 23:57:04 +01:00
padding: var(--spacing-xs) var(--spacing-s); // sass-lint:disable-line shorthand-values
2018-12-06 18:48:18 +01:00
align-self: center; // fixes buttons next to tall elements inside one with `display: flex`
2019-10-25 19:36:41 +02:00
background-color: var(--lbry-teal-5);
2018-12-06 18:48:18 +01:00
border-radius: 1rem;
color: var(--lbry-white);
2018-12-06 18:48:18 +01:00
transition: background-color 0.2s;
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
&:hover {
background-color: var(--lbry-teal-3);
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
[data-mode="dark"] & {
background-color: var(--lbry-teal-4);
2018-11-29 00:36:23 +01:00
}
}
2018-12-06 18:48:18 +01:00
}
2018-11-29 00:36:23 +01:00
2018-12-06 18:48:18 +01:00
.button--uppercase {
text-transform: uppercase;
2018-11-29 00:36:23 +01:00
}