Skip to content

Commit

Permalink
Merge branch 'main' into docs/davids-article
Browse files Browse the repository at this point in the history
  • Loading branch information
mrosvik authored Apr 19, 2024
2 parents e14bd2a + fc6c0c5 commit 8439cca
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 46 deletions.
1 change: 1 addition & 0 deletions packages/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@import url('./react-css-modules.css');
@import url('./utils.css');
@import url('./alert.css');
@import url('./ingress.css');
40 changes: 40 additions & 0 deletions packages/css/ingress.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@layer fds.ingress {
.fds-ingress {
--fdsc-bottom-spacing: var(--fds-spacing-5);

margin: 0;
color: var(--fds-semantic-text-neutral-default);
}

.fds-ingress--spacing {
margin-bottom: var(--fdsc-bottom-spacing);
}

.fds-ingress--medium {
--fdsc-bottom-spacing: var(--fds-spacing-5);

font: var(--fds-typography-ingress-medium);
font-family: inherit;
}

.fds-ingress--large {
--fdsc-bottom-spacing: var(--fds-spacing-6);

font: var(--fds-typography-ingress-large);
font-family: inherit;
}

.fds-ingress--small {
--fdsc-bottom-spacing: var(--fds-spacing-7);

font: var(--fds-typography-ingress-small);
font-family: inherit;
}

.fds-ingress--xsmall {
--fdsc-bottom-spacing: var(--fds-spacing-8);

font: var(--fds-typography-ingress-xsmall);
font-family: inherit;
}
}
20 changes: 0 additions & 20 deletions packages/css/react-css-modules.css
Original file line number Diff line number Diff line change
Expand Up @@ -444,26 +444,6 @@
}
}

@layer fds.ingress {
.fds-ingress-ingress-9b33da65 {
--fdsc-bottom-spacing: var(--fds-spacing-5);

margin: 0;
color: var(--fds-semantic-text-neutral-default);
}

.fds-ingress-ingress-9b33da65.fds-ingress-spacing-9b33da65 {
margin-bottom: var(--fdsc-bottom-spacing);
}

.fds-ingress-ingress-9b33da65.fds-ingress-medium-9b33da65 {
--fdsc-bottom-spacing: var(--fds-spacing-5);

font: var(--fds-typography-ingress-medium);
font-family: inherit;
}
}

@layer fds.label {
.fds-label-label-e0249167 {
--fdsc-bottom-spacing: var(--fds-spacing-1);
Expand Down

This file was deleted.

14 changes: 7 additions & 7 deletions packages/react/src/components/Typography/Ingress/Ingress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { Slot } from '@radix-ui/react-slot';

import type { OverridableComponent } from '../../../types/OverridableComponent';

import classes from './Ingress.module.css';

export type IngressProps = {
/** Changes text sizing */
size?: 'medium';
/** Changes text sizing
* @default 'medium'
*/
size?: 'large' | 'medium' | 'small' | 'xsmall';
/** Adds margin-bottom */
spacing?: boolean;
/**
Expand All @@ -32,10 +32,10 @@ export const Ingress: OverridableComponent<IngressProps, HTMLParagraphElement> =
<Component
ref={ref}
className={cl(
classes.ingress,
classes[size],
`fds-ingress`,
`fds-ingress--${size}`,
{
[classes.spacing]: !!spacing,
'fds-ingress--spacing': !!spacing,
},
className,
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const Preview: Story = {
size: 'medium',
description: '',
error: '',
hideLabel: false,
cols: 40,
},
};
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/form/Textarea/Textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const Textarea = forwardRef<HTMLTextAreaElement, TextareaProps>(
classes.formField,
textareaProps.disabled && classes.disabled,
readOnly && classes.readonly,
hasError && classes.error,
className,
)}
>
Expand Down

0 comments on commit 8439cca

Please sign in to comment.