Skip to content

Commit

Permalink
feat(flat): add new flat variant for use in auro-components
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-capsule42 committed Jul 3, 2024
1 parent 699def3 commit 49a6bcf
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"csspart"
]
}
2 changes: 1 addition & 1 deletion docs/partials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In cases were the action of the button would not fit the criteria above, it is m

These examples illustrate the core button types and a `disabled` state on dark backgrounds using the `onDark` attribute.

<div class="exampleWrapper">
<div class="exampleWrapper--ondark">
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../../apiExamples/onDark.html) -->
<!-- AURO-GENERATED-CONTENT:END -->
</div>
Expand Down
76 changes: 72 additions & 4 deletions src/colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ auro-loader {
}

/**
* SECONDARY VARIANT STYLES
*/
* SECONDARY VARIANT STYLES
*/
&[variant='secondary'] {
--ds-auro-button-container-color: var(--ds-color-container-ui-secondary-default-default, #{$ds-color-container-ui-secondary-default-default});
--ds-auro-button-container-image: var(--ds-color-container-ui-secondary-default-default, #{$ds-color-container-ui-secondary-default-default});
Expand Down Expand Up @@ -139,8 +139,8 @@ auro-loader {
}

/**
* TERTIARY VARIANT STYLES
*/
* TERTIARY VARIANT STYLES
*/
&[variant='tertiary'] {
--ds-auro-button-container-color: var(--ds-color-container-ui-tertiary-default-default, #{$ds-color-container-ui-tertiary-default-default});
--ds-auro-button-container-image: var(--ds-color-container-ui-tertiary-default-default, #{$ds-color-container-ui-tertiary-default-default});
Expand Down Expand Up @@ -185,6 +185,42 @@ auro-loader {
}
}
}

/**
* FLAT VARIANT STYLES
*/
&[variant='flat'] {
color: var(--ds-color-icon-ui-default-default);
background-color: transparent;
background-image: none;
border-color: transparent;

@media (hover: hover) {
&:active,
&:hover {
color: var(--ds-color-icon-ui-hover-default);
background-color: transparent;
background-image: none;
border-color: transparent;
}
}

&:disabled {
color: var(--ds-color-icon-ui-disabled-default);
background-color: transparent;
background-image: none;
border-color: transparent;

@media (hover: hover) {
&:hover {
color: var(--ds-color-icon-ui-disabled-default);
background-color: transparent;
background-image: none;
border-color: transparent;
}
}
}
}
}

&[ondark] {
Expand Down Expand Up @@ -331,5 +367,37 @@ auro-loader {
}
}
}

&[variant='flat'] {
color: var(--ds-color-icon-ui-default-default);
background-color: transparent;
border-color: transparent;

@media (hover: hover) {
&:active,
&:hover {
color: var(--ds-color-icon-ui-hover-default);
background-color: transparent;
background-image: none;
border-color: transparent;
}
}

&:disabled {
color: var(--ds-color-icon-ui-disabled-default);
background-color: transparent;
background-image: none;
border-color: transparent;

@media (hover: hover) {
&:hover {
color: var(--ds-color-icon-ui-disabled-default);
background-color: transparent;
background-image: none;
border-color: transparent;
}
}
}
}
}
}
11 changes: 11 additions & 0 deletions src/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,17 @@ slot {
}
}

&[variant='flat'] {
height: unset;
width: unset;
min-height: unset;
max-height: unset;
border: 0;
border-radius: unset;
gap: unset;
padding: unset;
}

&[ondark] {
&:disabled {
cursor: not-allowed;
Expand Down
6 changes: 3 additions & 3 deletions src/tokens.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
:host {
--ds-auro-button-border-color: var(--ds-color-container-ui-primary-active-default, $ds-color-container-ui-primary-active-default);
--ds-auro-button-container-color: var(--ds-color-container-ui-primary-active-default, $ds-color-container-ui-primary-active-default);
--ds-auro-button-container-image: var(--ds-color-container-ui-primary-active-default, $ds-color-container-ui-primary-active-default);
--ds-auro-button-text-color: var(--ds-color-text-primary-inverse, $ds-color-text-primary-inverse);
--ds-auro-button-container-color: var(--ds-color-ui-default-default, $ds-color-ui-default-default);
--ds-auro-button-container-image: var(--ds-color-ui-default-default, $ds-color-ui-default-default);
--ds-auro-button-border-color: var(--ds-color-ui-default-default, $ds-color-ui-default-default);

// THE BELOW TOKEN SEEMS WRONG - WAITING FOR RESPONSE FROM JUNE
--ds-auro-button-border-inset-color: var(--ds-color-border-emphasis-inverse, $ds-color-border-emphasis-inverse);
Expand Down

0 comments on commit 49a6bcf

Please sign in to comment.