Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V15 button props #168

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 75 additions & 18 deletions src/components/button/styles/CdrButton.module.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,85 @@
@import '../../../styles/settings/_index.scss';
@import './vars/CdrButton.vars.scss';

.cdr-button {
@include cdr-button-base-mixin;
background-color: var(--cdr-button-background-color, #{$cdr-color-background-button-secondary-rest});
border: none;
border-radius: var(--cdr-button-radius, #{$cdr-radius-softer});
box-shadow: inset 0 0 0 var(--cdr-button-box-shadow-offset-x, 0) var(--cdr-button-box-shadow-color, #{$cdr-color-border-button-secondary-rest});
color: var(--cdr-button-text-color, #{$cdr-color-text-button-secondary});
cursor: pointer;
display: var(--cdr-button-display, inline-flex);
fill: var(--cdr-button-fill-color, #{$cdr-color-icon-default});
font-family: var(--cdr-button-font-family, #{$cdr-font-family-sans});
font-size: var(--cdr-button-text, 1.6rem);
font-style: normal;
font-weight: 500;
justify-content: var(--cdr-button-justify, normal);
letter-spacing: -.008rem;
line-height: var(--cdr-button-line-height, 2.2rem);
outline: none;
overflow: visible;
margin: 0;
padding: var(--cdr-button-padding, #{$cdr-space-inset-one-x-squish});
text-align: left;
text-decoration: var(--cdr-button-text-decoration, none);
text-transform: none;
vertical-align: middle;
transition: box-shadow $cdr-duration-2-x $cdr-timing-function-ease, background-color $cdr-duration-2-x $cdr-timing-function-ease, color $cdr-duration-2-x $cdr-timing-function-ease, fill $cdr-duration-2-x $cdr-timing-function-ease;
width: var(--cdr-button-width, auto);

&:hover,
&:active,
&:focus {
background-color: var(--cdr-button-background-color);
box-shadow: inset 0 0 0 var(--cdr-button-box-shadow-offset-x, 0) var(--cdr-button-box-shadow-color),
var(--cdr-prominence-raised, #{$cdr-prominence-raised});
color: var(--cdr-button-text-color);
fill: var(--cdr-button-fill-color);
outline: var(--cdr-button-outline, none);
outline-color: var(--cdr-button-outline-color, -webkit-focus-ring-color);
outline-offset: var(--cdr-button-outline-color, 0);
text-decoration: var(--cdr-button-text-decoration);
}

&:active {
color: var(--cdr-button-text-color);
fill: var(--cdr-button-fill-color);
background-color: var(--cdr-button-background-color);
box-shadow: inset 0 0 0 var(--cdr-button-box-shadow-offset-x, 0) var(--cdr-button-box-shadow-color), inset 0 0 0 var(--cdr-button-box-shadow-inset-x, 0) var(--cdr-button-box-shadow-color-active-inset);
}

&[disabled] {
cursor: not-allowed;
background-color: var(--cdr-button-background-disabled-color, #{$cdr-color-background-button-default-disabled});
box-shadow: inset 0 0 0 1px var(--cdr-button-box-shadow-disabled-color, #{$cdr-color-border-button-default-disabled});
color: var(--cdr-button-text-disabled-color, #{$cdr-color-text-button-primary-disabled});
fill: var(--cdr-button-fill-disabled-color, #{$cdr-color-text-button-primary-disabled});
}

svg {
@include cdr-button-base-icon-mixin;
align-self: center;
height: var(--cdr-button-icon-size, #{$cdr-icon-size});
fill: inherit;
width: var(--cdr-button-icon-size, #{$cdr-icon-size});

}

&.cdr-button--has-icon-left svg {
margin-right: $cdr-space-quarter-x;
&.cdr-button--has-icon-left {
padding-left: var(--cdr-button-padding-bump);

svg {
margin-right: $cdr-space-quarter-x;
}
}

&.cdr-button--has-icon-right svg {
margin-left: $cdr-space-quarter-x;

&.cdr-button--has-icon-right {
padding-right: var(--cdr-button-padding-bump);

svg {
margin-right: $cdr-space-quarter-x;
}
}

/* Modifier style variants
Expand Down Expand Up @@ -40,32 +107,22 @@
/* Size variants
========================================================================== */

/* Large
========== */
&--large {
@include cdr-button-large-mixin;
}

/* Medium
========== */
&--medium {
@include cdr-button-medium-mixin;
}

/* Small
========== */

&--small {
@include cdr-button-small-mixin;
}

/* Icon Only
========= */

&--icon-only {
@include cdr-button-icon-only-mixin;

& > svg {
&>svg {
margin: 0;
}
}
Expand Down Expand Up @@ -171,4 +228,4 @@
@include cdr-button-full-width-mixin;
}
}
}
}
Loading