Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 4554f79

Browse files
Add rounded corners to input components (#510)
Creates a new cornerRadiusRound design token and applies that to the button, text area, and text field components.
1 parent 21ec3ec commit 4554f79

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

src/button/button.styles.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
buttonSecondaryForeground,
2727
buttonSecondaryHoverBackground,
2828
contrastActiveBorder,
29+
cornerRadiusRound,
2930
designUnit,
3031
disabledOpacity,
3132
focusBorder,
@@ -62,7 +63,7 @@ const BaseButtonStyles = css`
6263
line-height: ${typeRampBaseLineHeight};
6364
color: ${buttonPrimaryForeground};
6465
background: ${buttonPrimaryBackground};
65-
border-radius: 2px;
66+
border-radius: calc(${cornerRadiusRound} * 1px);
6667
fill: currentColor;
6768
cursor: pointer;
6869
}

src/design-tokens.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export const borderWidth = create<number>('border-width').withDefault(1);
2929
export const contrastActiveBorder = create<string>('contrast-active-border', '--vscode-contrastActiveBorder').withDefault('#f38518');
3030
export const contrastBorder = create<string>('contrast-border', '--vscode-contrastBorder').withDefault('#6fc3df');
3131
export const cornerRadius = create<number>('corner-radius').withDefault(0);
32+
export const cornerRadiusRound = create<number>('corner-radius-round').withDefault(2);
3233
export const designUnit = create<number>('design-unit').withDefault(4);
3334
export const disabledOpacity = create<number>('disabled-opacity').withDefault(0.4);
3435
export const focusBorder = create<string>('focus-border', '--vscode-focusBorder').withDefault('#007fd4');

src/text-area/text-area.styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@microsoft/fast-foundation';
1212
import {
1313
borderWidth,
14-
cornerRadius,
14+
cornerRadiusRound,
1515
designUnit,
1616
disabledOpacity,
1717
dropdownBorder,
@@ -44,7 +44,7 @@ export const textAreaStyles = (
4444
position: relative;
4545
color: ${inputForeground};
4646
background: ${inputBackground};
47-
border-radius: calc(${cornerRadius} * 1px);
47+
border-radius: calc(${cornerRadiusRound} * 1px);
4848
border: calc(${borderWidth} * 1px) solid ${dropdownBorder};
4949
font: inherit;
5050
font-size: ${typeRampBaseFontSize};

src/text-field/text-field.styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {
1111
} from '@microsoft/fast-foundation';
1212
import {
1313
borderWidth,
14-
cornerRadius,
14+
cornerRadiusRound,
1515
designUnit,
1616
disabledOpacity,
1717
dropdownBorder,
@@ -42,7 +42,7 @@ export const textFieldStyles = (
4242
flex-direction: row;
4343
color: ${inputForeground};
4444
background: ${inputBackground};
45-
border-radius: calc(${cornerRadius} * 1px);
45+
border-radius: calc(${cornerRadiusRound} * 1px);
4646
border: calc(${borderWidth} * 1px) solid ${dropdownBorder};
4747
height: calc(${inputHeight} * 1px);
4848
min-width: ${inputMinWidth};

0 commit comments

Comments
 (0)