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

feat / black-mode button #2034

Merged
merged 1 commit into from
Sep 2, 2024
Merged
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
12 changes: 12 additions & 0 deletions packages/ketchup/src/button.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ <h5>Neutral : Black mode</h5>
styling="flat"
black-mode
></kup-button>
<kup-button
label="Flat"
class="kup-neutral"
styling="flat"
icon="favorite"
black-mode
></kup-button>
<kup-button
class="kup-large kup-neutral"
icon="favorite"
black-mode
></kup-button>
</div>

<h4>Danger:</h4>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
* Used to export every prop in an object.
*/
export enum KupButtonListProps {
blackMode = 'Forced component on a black background. It prescinds the theme',
contentAlign = 'Manage the align contents of the button. It could be right, left, center, around, evenly, between. Center is the default',
columns = 'Number of columns.',
customStyle = 'Custom style of the component.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ export class KupButtonList {
/*-------------------------------------------------*/
/* P r o p s */
/*-------------------------------------------------*/
/**
* Sets the type of the button.
* @default false
*/
@Prop() blackMode: boolean = false;
/**
* Sets the type of the button.
* @default null
Expand Down Expand Up @@ -231,6 +236,7 @@ export class KupButtonList {
}

const props: FButtonProps = {
blackMode: data.blackMode,
contentAlign: data.contentAlign,
checked: data.checked,
disabled: data.disabled,
Expand Down Expand Up @@ -310,6 +316,9 @@ export class KupButtonList {
if (this.customStyle != null && this.customStyle.trim() != '') {
data.customStyle = this.customStyle;
}
if (this.blackMode == true) {
data.blackMode = true;
}
if (this.disabled == true || node.disabled == true) {
data.disabled = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

| Property | Attribute | Description | Type | Default |
| --------------- | ---------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| `blackMode` | `black-mode` | Sets the type of the button. | `boolean` | `false` |
| `columns` | `columns` | Number of columns. | `number` | `0` |
| `contentAlign` | `content-align` | Sets the type of the button. | `FButtonAlign.AROUND \| FButtonAlign.BETWEEN \| FButtonAlign.CENTER \| FButtonAlign.EVENLY \| FButtonAlign.LEFT \| FButtonAlign.RIGHT` | `FButtonAlign.CENTER` |
| `customStyle` | `custom-style` | Custom style of the component. | `string` | `''` |
Expand Down
20 changes: 18 additions & 2 deletions packages/ketchup/src/f-components/f-button/f-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -516,10 +516,26 @@
}
&.#{$kup-class-black-mode} {
.button {
--kup_button_text_color: var(--kup-gray-color-0);
--kup_button_text_color: #fff;
--kup_button_background_color_hover: #393939;
--kup_button_background_color_focus: #525252;
--kup_button_background_color_active: #525252;
.f-image .iconWrapper .f-image__icon {
background: #fff !important;
}
}
.icon-button {
--kup_button_text_color: var(--kup-gray-color-0);
--kup_button_text_color: #fff;
.f-image .iconWrapper .f-image__icon {
background: #fff !important;
}
&:hover {
background-color: #393939;
}
&:focus,
&:active {
background-color: #525252;
}
}
}
}
Expand Down