Skip to content

chore: fixed issue #2304 by adding better documentation to the font-w… #2324

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions src/docs/font-weight.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { ApiTable } from "@/components/api-table.tsx";
import { CustomizingYourTheme, ResponsiveDesign, UsingACustomValue } from "@/components/content.tsx";
import { Example } from "@/components/example.tsx";
import { Figure } from "@/components/figure.tsx";
import { CodeExample } from "@/components/code-example.tsx";


export const title = "font-weight";
export const description = "Utilities for controlling the font weight of an element.";
Expand Down Expand Up @@ -82,6 +84,24 @@ Use utilities like `font-thin` and `font-bold` to set the font weight of an elem

<UsingACustomValue element="p" utility="font" value="1000" name="font weight" variable="font-weight" />

If you want a child element (like a <code>&lt;th&gt;</code>) to inherit its font weight from a parent, use the <code>font-[weight:inherit]</code> syntax to avoid ambiguity:

<div className="not-prose">
<CodeExample
example={{
lang: "html",
code: `<table class="font-bold">
<tbody>
<tr>
<th class="font-[weight:inherit]">Lorem ipsum dolor sit amet...</th>
<td>Lorem ipsum dolor sit amet...</td>
</tr>
</tbody>
</table>`,
}}
/>
</div>

### Responsive design

<ResponsiveDesign element="p" property="font-weight" defaultClass="font-normal" featuredClass="font-bold" />
Expand Down