Skip to content
This repository has been archived by the owner on Oct 23, 2024. It is now read-only.

update all upsell tokens to violet(400) #374

Merged
merged 3 commits into from
Feb 7, 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
Binary file modified lost-pixel/baseline/components-button-props--format.png
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.
Binary file modified lost-pixel/baseline/tokens-color--upsell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 3 additions & 36 deletions src/components/Button/Button.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ export const ButtonStyled = styled.button<any>`
${buttonTextShift};
${buttonChecked};
${buttonUpsell};
${buttonUpsellNew}
`;

const sizePads = {
Expand Down Expand Up @@ -515,45 +514,13 @@ function buttonTextShift({ variant, textShift, iconPosition }) {

// Temporary until CSSVar design tokens are released and Button
// style logic is rewritten.
function buttonUpsell({ format, theme }) {
if (format !== 'upsell') return;

const color = core.color.upsell.sm;
const colorHover =
theme.name === 'dark'
? 'linear-gradient(to right,#00cc6b,#00cca7,#00b0e7)'
: 'linear-gradient(to right,#00de59,#00d39e,#00aaf3)';
const colorActive =
theme.name === 'dark'
? 'linear-gradient(to right,#009c52,#00a385,#008cb8)'
: 'linear-gradient(to right,#00af46,#00a47a,#0089c4)';

return css`
border: 1px solid transparent;
background: ${color} padding-box, ${color} border-box;
color: #fff;

&:active {
background: ${color} padding-box, ${colorActive} border-box;
transform: scale(0.98);
color: #fff;
}

&:hover:not(:active) {
background: ${colorHover} padding-box, ${colorHover} border-box;
border: 1px solid transparent;
color: #fff;
}
`;
}

function buttonUpsellNew({ format }) {
if (format !== 'upsell-new') return;
function buttonUpsell({ format }) {
if (!format.includes('upsell')) return;

return css`
border: 1px solid transparent;
background: ${core.color.upsell.New};
color: ${violet(0)};
color: #fff;

&:active {
background: ${violet(600)};
Expand Down
5 changes: 3 additions & 2 deletions src/tokens/color/upsell/sm.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Token, readToken } from '../../util';
import { violet } from '../../../color/colors';

const dark = 'linear-gradient(to right,#00AA59,#00B191,#0098C8)';
const light = 'linear-gradient(to right,#00BE4C,#00B285,#0095D5)';
const dark = violet(400);
const light = violet(400);

const token: Token = {
default: 'light',
Expand Down
5 changes: 3 additions & 2 deletions src/tokens/color/upsell/xl.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Token, readToken } from '../../util';
import { violet } from '../../../color/colors';

const dark = 'linear-gradient(to right,#00AA59,#00B191,#0098C8)';
const light = 'linear-gradient(to right,#00B655,#00B285,#00A9D5)';
const dark = violet(400);
const light = violet(400);

const token: Token = {
default: 'light',
Expand Down
Loading