Skip to content

Commit

Permalink
feat(ld-button): add ghost on brand variant
Browse files Browse the repository at this point in the history
BREAKING CHANGE
  • Loading branch information
renet authored and borisdiakur committed Dec 8, 2021
1 parent d468293 commit 2540246
Show file tree
Hide file tree
Showing 70 changed files with 1,743 additions and 950 deletions.
1,660 changes: 1,129 additions & 531 deletions screenshot/builds/master.json

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
Diff not rendered.
Diff not rendered.
130 changes: 68 additions & 62 deletions src/liquid/components/ld-button/ld-button.css
Original file line number Diff line number Diff line change
Expand Up @@ -391,86 +391,92 @@
}
}

.ld-button--on-brand-color {
background-color: var(--ld-button-on-brand-bg-color, var(--ld-col-wht));
color: var(--ld-button-on-brand-text-color, var(--ld-thm-primary));
.ld-button--brand-color {
&:where(:not(.ld-button--secondary):not(.ld-button--ghost)) {
background-color: var(--ld-button-brand-bg-color, var(--ld-col-wht));
color: var(--ld-button-brand-text-color, var(--ld-thm-primary));

&:where(&:not(:disabled):not([aria-disabled='true'])) {
&:where(:focus:focus-visible) {
color: var(
--ld-button-on-brand-text-color-focus,
var(--ld-thm-primary-focus)
);
}
@media (hover: hover) {
&:where(:hover) {
&:where(&:not(:disabled):not([aria-disabled='true'])) {
&:where(:focus:focus-visible) {
color: var(
--ld-button-brand-text-color-focus,
var(--ld-thm-primary-focus)
);
}
@media (hover: hover) {
&:where(:hover) {
background-color: var(
--ld-button-brand-bg-color-hover,
var(--ld-col-wht-alpha-high)
);
}
}
&:where(:active),
&:where(:active:focus-visible) {
background-color: var(
--ld-button-on-brand-bg-color-hover,
var(--ld-col-wht-alpha-high)
--ld-button-brand-bg-color-active,
var(--ld-col-wht-alpha-medium)
);
}
}
&:where(:active),
&:where(:active:focus-visible) {
background-color: var(
--ld-button-on-brand-bg-color-active,
var(--ld-col-wht-alpha-medium)
);
}
}
}

.ld-button--secondary-on-brand-color {
background-color: transparent;
color: var(--ld-button-secondary-on-brand-text-color, var(--ld-col-wht));
box-shadow: inset 0px 0px 0px 2px;
&.ld-button--secondary,
&.ld-button--ghost {
background-color: transparent;
color: var(--ld-button-secondary-brand-text-color, var(--ld-col-wht));

.ld-button__progress::after {
background-color: var(
--ld-button-secondary-on-brand-progress-color,
var(--ld-col-wht)
);
}

&:where(&:not(:disabled):not([aria-disabled='true'])) {
&:where(:focus:focus-visible) {
color: var(
--ld-button-secondary-on-brand-text-color,
var(--ld-col-wht-alpha-high)
.ld-button__progress::after {
background-color: var(
--ld-button-secondary-brand-progress-color,
var(--ld-col-wht)
);
}

.ld-button__progress::after {
background-color: var(
--ld-button-secondary-on-brand-progress-color-focus,
&:where(&:not(:disabled):not([aria-disabled='true'])) {
&:where(:focus:focus-visible) {
color: var(
--ld-button-secondary-brand-text-color,
var(--ld-col-wht-alpha-high)
);

.ld-button__progress::after {
background-color: var(
--ld-button-secondary-brand-progress-color-focus,
var(--ld-col-wht-alpha-high)
);
}
}
}
@media (hover: hover) {
&:where(:hover) {
background-color: var(
--ld-button-secondary-on-brand-bg-color-hover,
var(--ld-col-wht-alpha-low)
);
@media (hover: hover) {
&:where(:hover) {
background-color: var(
--ld-button-secondary-brand-bg-color-hover,
var(--ld-col-wht-alpha-low)
);
}
}
}
&:where(:active),
&:where(:active:focus-visible) {
background-color: var(
--ld-button-secondary-on-brand-bg-color-active,
var(--ld-col-wht-alpha-lowest)
);
color: var(
--ld-button-secondary-on-brand-text-color,
var(--ld-col-wht-alpha-highest)
);

.ld-button__progress::after {
&:where(:active),
&:where(:active:focus-visible) {
background-color: var(
--ld-button-secondary-on-brand-progress-color-active,
--ld-button-secondary-brand-bg-color-active,
var(--ld-col-wht-alpha-lowest)
);
color: var(
--ld-button-secondary-brand-text-color,
var(--ld-col-wht-alpha-highest)
);

.ld-button__progress::after {
background-color: var(
--ld-button-secondary-brand-progress-color-active,
var(--ld-col-wht-alpha-highest)
);
}
}
}
}

&.ld-button--secondary {
box-shadow: inset 0px 0px 0px 2px;
}
}
18 changes: 8 additions & 10 deletions src/liquid/components/ld-button/ld-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,15 @@ export class LdButton implements InnerFocusable, ClonesAttributes {
@Prop({ mutable: true }) justifyContent?: 'start' | 'end' | 'between'

/** Display mode. */
@Prop() mode?:
| 'highlight'
| 'secondary'
| 'ghost'
| 'danger'
| 'on-brand-color'
| 'secondary-on-brand-color'
@Prop() mode?: 'highlight' | 'secondary' | 'ghost' | 'danger'

/** Used to specify the name of the control. */
@Prop() name?: string

// `onBrandColor` is not possible, as Stencil expects `on*` props to be events.
/** Style the button so that it looks good on the current theme's primary color. */
@Prop() brandColor?: boolean

/** Displays a progress bar at the bottom of the button. */
@Prop() progress?: 'pending' | number

Expand Down Expand Up @@ -122,7 +120,6 @@ export class LdButton implements InnerFocusable, ClonesAttributes {
}

private clickHiddenButton() {
console.log('drin')
const button = document.createElement('button')

button.style.pointerEvents = 'none'
Expand Down Expand Up @@ -199,10 +196,11 @@ export class LdButton implements InnerFocusable, ClonesAttributes {
render() {
const cl = getClassNames([
'ld-button',
this.size && `ld-button--${this.size}`,
this.mode && `ld-button--${this.mode}`,
this.alignText && `ld-button--align-text-${this.alignText}`,
this.justifyContent && `ld-button--justify-${this.justifyContent}`,
this.mode && `ld-button--${this.mode}`,
this.brandColor && `ld-button--brand-color`,
this.size && `ld-button--${this.size}`,
])

const Tag = this.href ? 'a' : 'button'
Expand Down
Loading

0 comments on commit 2540246

Please sign in to comment.