Skip to content

Commit

Permalink
Merge pull request smeup#2034 from smeup/feat/f-button/darkmode
Browse files Browse the repository at this point in the history
feat / black-mode button
  • Loading branch information
pasere-smeup authored Sep 2, 2024
2 parents 71033bf + 9a834ab commit 5375960
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 2 deletions.
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
1 change: 1 addition & 0 deletions packages/ketchup/src/components/kup-button-list/readme.md
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

0 comments on commit 5375960

Please sign in to comment.