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

[Typography]: Add table caption mixin #368

Merged
merged 4 commits into from
May 24, 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
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,16 @@
font-weight: tokens.$font-weight-bold;
}

// Table caption

@mixin table-caption {
text-transform: uppercase;
line-height: tokens.$text-input-line-height;
font-family: tokens.$font-family;
font-size: tokens.$body-text-m-font-size;
font-weight: tokens.$font-weight-regular;
}

// Other UI styles

// Text-input, text-area, dropdown, legend components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const body = {
},
};

export const table_caption_text = "Fudis table caption text";

export const text_xxl = "Fudis heading XXL (2.25rem) 500";
export const text_xl = "Fudis heading XL (1.75rem) 500";
export const text_lg = "Fudis heading LG (1.5rem) 500";
Expand All @@ -45,9 +47,9 @@ export const text_xs = "Fudis heading XS (1rem) 600";
export const text_xxs = "Fudis heading XXS (0.857rem) 600";

export const body_sm =
'Fudis body-text smd-regular (0.75rem) 400: "The quick brown fox jumps over the lazy dog."';
'Fudis body-text sm-regular (0.75rem) 400: "The quick brown fox jumps over the lazy dog."';
export const body_sm_light =
'Fudis body-text smd-light (0.75rem) 300: "The quick brown fox jumps over the lazy dog."';
'Fudis body-text sm-light (0.75rem) 300: "The quick brown fox jumps over the lazy dog."';
export const body_md =
'Fudis body-text md-regular (0.875rem) 400: "The quick brown fox jumps over the lazy dog."';
export const body_md_light =
Expand Down Expand Up @@ -161,3 +163,24 @@ export const body_lg_light =
sampleText={body_sm_light}
fontFamily={body.type.primary}
/>

## Table Caption

<table>
<th>Mixin</th>
<th>Styles</th>
<th>Example</th>
<tbody>
<tr>
<td>table-caption</td>
<td>
<p>Size: 14px / 0.875rem</p>
<p>Weight: 400 / Regular</p>
<p>Transform: Uppercase</p>
</td>
<td>
<p class="fudis-table-caption">{table_caption_text}</p>
</td>
</tr>
</tbody>
</table>
5 changes: 5 additions & 0 deletions ngx-fudis/projects/ngx-fudis/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/

@use "@angular/material" as mat;
@use "./src/lib/foundations/typography/mixins.scss" as typography;

// Fudis theme import
@import "./src/lib/theme/component-themes-to-apply";
Expand Down Expand Up @@ -41,6 +42,10 @@ a.sbdocs {
font-weight: 600;
}

tr td p.fudis-table-caption {
@include typography.table-caption();
}

.storybook {
&__wrapper-border {
border: 2px solid var(--fudis-color-primary);
Expand Down
Loading