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

Text field error spacing #2399

Merged
merged 14 commits into from
Sep 26, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
mollykreis marked this conversation as resolved.
Show resolved Hide resolved
"comment": "Update internal spacing between elements within the nimble-text-field",
"packageName": "@ni/nimble-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
8 changes: 6 additions & 2 deletions packages/nimble-components/src/text-field/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
bodyFont,
controlLabelFontColor,
controlLabelDisabledFontColor,
mediumPadding
smallPadding
} from '../theme-provider/design-tokens';
import { appearanceBehavior } from '../utilities/style/appearance';
import { TextFieldAppearance } from './types';
Expand Down Expand Up @@ -61,8 +61,9 @@ export const styles = css`
align-items: center;
justify-content: center;
border: 0px solid rgba(${borderRgbPartialColor}, 0.3);
gap: ${mediumPadding};
gap: ${smallPadding};
padding: ${borderWidth};
padding-left: calc(${borderWidth} + ${smallPadding});
}

:host([readonly]) .root {
Expand Down Expand Up @@ -117,6 +118,7 @@ export const styles = css`
slot[name='start']::slotted(*) {
flex: none;
opacity: 0.6;
margin-right: ${smallPadding};
}

:host([disabled]) slot[name='start']::slotted(*) {
Expand Down Expand Up @@ -168,6 +170,7 @@ export const styles = css`
[part='end']::after {
content: '';
position: absolute;
margin-left: calc(-1 * (${borderWidth} + ${smallPadding}));
mollykreis marked this conversation as resolved.
Show resolved Hide resolved
bottom: calc(-1 * ${borderWidth});
width: 0px;
height: 0px;
Expand Down Expand Up @@ -250,6 +253,7 @@ export const styles = css`
.root {
border-width: ${borderWidth};
padding: 0;
padding-left: ${smallPadding};
}
`
),
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/.storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,5 @@ configureActions({
depth: 1
});

// Update the GUID on this line to trigger a turbosnap full rebuild: 35fca962-ed23-4476-979e-094c9a0b48f4
// Update the GUID on this line to trigger a turbosnap full rebuild: 1c1078d9-af89-4624-93d1-7e2639a09ea9
// See https://www.chromatic.com/docs/turbosnap/#full-rebuilds