]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Update font spec type (#11605)
authorJacco van den Berg <jaccoberg2281@gmail.com>
Mon, 4 Dec 2023 18:56:38 +0000 (19:56 +0100)
committerGitHub <noreply@github.com>
Mon, 4 Dec 2023 18:56:38 +0000 (19:56 +0100)
docs/general/fonts.md
src/types/index.d.ts

index 9b2d6c842ce3271056fc4bead2e2c0c2abb07bdb..df9f4f6cb6762a2ec24479b627c6854be5dd7c2c 100644 (file)
@@ -29,7 +29,7 @@ let chart = new Chart(ctx, {
 | `family` | `string` | `"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif"` | Default font family for all text, follows CSS font-family options.
 | `size` | `number` | `12` | Default font size (in px) for text. Does not apply to radialLinear scale point labels.
 | `style` | `string` | `'normal'` | Default font style. Does not apply to tooltip title or footer. Does not apply to chart title. Follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-| `weight` | `string` | `undefined` | Default font weight (boldness). (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)).
+| `weight` | `normal` \| `bold` \| `lighter` \| `bolder` \| `number` | `undefined` | Default font weight (boldness). (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight)).
 | `lineHeight` | `number`\|`string` | `1.2` | Height of an individual line of text (see [MDN](https://developer.mozilla.org/en-US/docs/Web/CSS/line-height)).
 
 ## Missing Fonts
index 12a6ed6c1fa4716e507d41e685cf4e644dab24e6..6e661188a0b19c4b1c689e4f72c65c9c446bf90f 100644 (file)
@@ -1777,7 +1777,7 @@ export interface FontSpec {
   /**
    * Default font weight (boldness). (see MDN).
    */
-  weight: string | null;
+  weight: 'normal' | 'bold' | 'lighter' | 'bolder' | number | null;
   /**
    * Height of an individual line of text (see MDN).
    * @default 1.2