@mbao01/common 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ declare const Select: {
5
5
  Group: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
6
6
  Value: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
7
7
  Trigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & {
8
- variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
8
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
9
9
  outline?: boolean | undefined;
10
10
  wide?: boolean | undefined;
11
11
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -15,7 +15,7 @@ declare const Select: {
15
15
  } & React.RefAttributes<HTMLDivElement>>;
16
16
  Label: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
17
  Item: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
18
- variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
18
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | undefined;
19
19
  outline?: boolean | undefined;
20
20
  wide?: boolean | undefined;
21
21
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -1,11 +1,11 @@
1
1
  export declare const getSelectTriggerClasses: (props?: ({
2
- variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
2
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  wide?: boolean | null | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
6
6
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
7
  export declare const getSelectItemClasses: (props?: ({
8
- variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
8
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | null | undefined;
9
9
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
10
10
  export declare const getSelectLabelClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
11
11
  export declare const getSelectSeparatorClasses: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  declare const Textarea: React.ForwardRefExoticComponent<Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "ref" | "size"> & {
3
- variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
3
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | undefined;
4
4
  outline?: boolean | undefined;
5
5
  wide?: boolean | undefined;
6
6
  size?: "xs" | "sm" | "md" | "lg" | undefined;
@@ -1,5 +1,5 @@
1
1
  export declare const getTextareaClasses: (props?: ({
2
- variant?: "accent" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
2
+ variant?: "accent" | "default" | "error" | "info" | "primary" | "secondary" | "success" | "warning" | "ghost" | null | undefined;
3
3
  outline?: boolean | null | undefined;
4
4
  wide?: boolean | null | undefined;
5
5
  size?: "xs" | "sm" | "md" | "lg" | null | undefined;
@@ -0,0 +1 @@
1
+ export declare const TypographyDemo: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare const TypographyScale: () => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mbao01/common",
3
3
  "private": false,
4
- "version": "0.0.37",
4
+ "version": "0.0.39",
5
5
  "type": "module",
6
6
  "author": "Ayomide Bakare",
7
7
  "license": "MIT",
@@ -84,6 +84,7 @@
84
84
  "@radix-ui/react-toggle": "^1.0.3",
85
85
  "@radix-ui/react-toggle-group": "^1.0.4",
86
86
  "@radix-ui/react-tooltip": "^1.0.7",
87
+ "@tailwindcss/typography": "^0.5.14",
87
88
  "class-variance-authority": "^0.7.0",
88
89
  "clsx": "^2.1.0",
89
90
  "cmdk": "^1.0.0",
@@ -145,5 +146,5 @@
145
146
  "react-dom": "^18.2.0",
146
147
  "typescript": "^5.2.2"
147
148
  },
148
- "gitHead": "dc6e10ed230647d7e4626895c8d9b6a6808daab5"
149
+ "gitHead": "02c3be513cd89851dabe9fa84289a247a8e92630"
149
150
  }
package/plugin.js CHANGED
@@ -1 +1,5 @@
1
- module.exports = [require("daisyui"), require("tailwindcss-animate")];
1
+ module.exports = [
2
+ require("@tailwindcss/typography"),
3
+ require("daisyui"),
4
+ require("tailwindcss-animate"),
5
+ ];
@@ -1,10 +1,11 @@
1
1
  import { cva } from "../../../libs";
2
2
 
3
3
  export const getSelectTriggerClasses = cva(
4
- "select flex items-center justify-between rounded-md text-sm text-left ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
4
+ "select flex items-center justify-between rounded-md text-sm text-left disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 transition-all duration-100",
5
5
  {
6
6
  variants: {
7
7
  variant: {
8
+ default: "bg-transparent",
8
9
  primary: "select-primary",
9
10
  secondary: "select-secondary",
10
11
  accent: "select-accent",
@@ -31,6 +32,16 @@ export const getSelectTriggerClasses = cva(
31
32
  size: undefined,
32
33
  className: "min-h-fit h-10",
33
34
  },
35
+ {
36
+ variant: undefined,
37
+ outline: true,
38
+ className: "border-neutral-content",
39
+ },
40
+ {
41
+ variant: "default",
42
+ outline: true,
43
+ className: "border-base-content",
44
+ },
34
45
  ],
35
46
  }
36
47
  );
@@ -40,6 +51,7 @@ export const getSelectItemClasses = cva(
40
51
  {
41
52
  variants: {
42
53
  variant: {
54
+ default: "focus:bg-transparent focus:text-base-content",
43
55
  primary: "focus:bg-primary focus:text-primary-content",
44
56
  secondary: "focus:bg-secondary focus:text-secondary-content",
45
57
  accent: "focus:bg-accent focus:text-accent-content",
@@ -5,6 +5,7 @@ export const getTextareaClasses = cva(
5
5
  {
6
6
  variants: {
7
7
  variant: {
8
+ default: "bg-transparent",
8
9
  accent: "textarea-accent",
9
10
  error: "textarea-error",
10
11
  ghost: "textarea-ghost",
@@ -32,6 +33,16 @@ export const getTextareaClasses = cva(
32
33
  size: undefined,
33
34
  className: "min-h-fit h-10",
34
35
  },
36
+ {
37
+ variant: undefined,
38
+ outline: true,
39
+ className: "border-neutral-content",
40
+ },
41
+ {
42
+ variant: "default",
43
+ outline: true,
44
+ className: "border-base-content",
45
+ },
35
46
  ],
36
47
  }
37
48
  );
@@ -0,0 +1,476 @@
1
+ export const TypographyDemo = () => {
2
+ return (
3
+ <div className="min-h-screen py-8 flex flex-col justify-center relative overflow-hidden lg:py-12">
4
+ <img
5
+ src="/img/beams.jpg"
6
+ alt=""
7
+ className="fixed top-48 left-1/2 -translate-x-2/3 -translate-y-1/2 max-w-none"
8
+ width="1308"
9
+ />
10
+ <div className="absolute inset-0 bg-[url(/img/grid.svg)] bg-top [mask-image:linear-gradient(180deg,white,rgba(255,255,255,0))]"></div>
11
+ <div className="relative w-full px-6 py-12 shadow-xl shadow-slate-700/10 ring-1 ring-gray-900/5 md:max-w-3xl md:mx-auto lg:max-w-4xl lg:pt-16 lg:pb-28">
12
+ <div className="max-w-prose mx-auto lg:text-lg">
13
+ <svg className="h-6" fill="none" viewBox="0 0 297 24">
14
+ <path
15
+ className="fill-sky-400"
16
+ fillRule="evenodd"
17
+ d="M19.418.523c-5.178 0-8.415 2.589-9.71 7.767 1.943-2.59 4.208-3.56 6.797-2.913 1.477.37 2.533 1.44 3.702 2.627 1.903 1.933 4.107 4.17 8.92 4.17 5.178 0 8.414-2.59 9.708-7.768-1.941 2.59-4.207 3.56-6.796 2.913-1.477-.37-2.533-1.441-3.702-2.628C26.434 2.76 24.23.523 19.417.523zm-9.71 11.65c-5.177 0-8.413 2.59-9.708 7.767 1.942-2.589 4.207-3.56 6.796-2.913 1.477.37 2.533 1.441 3.702 2.628 1.904 1.932 4.107 4.169 8.92 4.169 5.178 0 8.414-2.59 9.709-7.767-1.942 2.589-4.208 3.56-6.797 2.912-1.477-.369-2.533-1.44-3.701-2.627-1.904-1.932-4.108-4.169-8.92-4.169z"
18
+ clipRule="evenodd"
19
+ ></path>
20
+ <path
21
+ className="fill-slate-900"
22
+ d="M59.31 8.962v-2.79h-3.328V2.414l-2.898.858v2.898h-2.468v2.79h2.468v6.44c0 3.489 1.771 4.723 6.225 4.186v-2.602c-2.2.107-3.327.134-3.327-1.584v-6.44h3.327zM72.013 6.171v1.905c-1.02-1.395-2.603-2.254-4.696-2.254-3.649 0-6.68 3.06-6.68 7.057 0 3.971 3.031 7.057 6.68 7.057 2.093 0 3.676-.859 4.696-2.28v1.931h2.897V6.171h-2.897zm-4.24 11.001c-2.415 0-4.24-1.797-4.24-4.293 0-2.495 1.825-4.293 4.24-4.293s4.24 1.798 4.24 4.293c0 2.496-1.825 4.293-4.24 4.293zM79.737 4.159c1.02 0 1.852-.859 1.852-1.851 0-1.02-.832-1.852-1.852-1.852s-1.851.832-1.851 1.852c0 .992.832 1.85 1.851 1.85zm-1.449 15.428h2.898V6.171h-2.898v13.416zM84.55 19.587h2.898V0h-2.897v19.587zM106.268 6.171l-2.629 9.257-2.791-9.257h-2.763l-2.818 9.257-2.602-9.257h-3.06l4.213 13.416h2.844l2.818-9.042 2.79 9.042h2.844l4.213-13.416h-3.059zM112.91 4.159c1.019 0 1.851-.859 1.851-1.851 0-1.02-.832-1.852-1.851-1.852-1.02 0-1.852.832-1.852 1.852 0 .992.832 1.85 1.852 1.85zm-1.449 15.428h2.898V6.171h-2.898v13.416zM124.78 5.822c-1.824 0-3.273.671-4.159 2.067V6.17h-2.898v13.416h2.898v-7.19c0-2.738 1.503-3.865 3.408-3.865 1.824 0 3.005 1.074 3.005 3.113v7.942h2.898V11.35c0-3.488-2.147-5.528-5.152-5.528zM143.677.805v7.271c-1.019-1.395-2.602-2.254-4.695-2.254-3.649 0-6.681 3.06-6.681 7.057 0 3.971 3.032 7.057 6.681 7.057 2.093 0 3.676-.859 4.695-2.28v1.931h2.898V.805h-2.898zm-4.239 16.367c-2.415 0-4.239-1.797-4.239-4.293 0-2.495 1.824-4.293 4.239-4.293s4.239 1.798 4.239 4.293c0 2.496-1.824 4.293-4.239 4.293z"
23
+ ></path>
24
+ <path
25
+ className="fill-sky-400"
26
+ d="M161.544 5.748h-10.182v2.61h3.717v11.23h2.728V8.357h3.737v-2.61zM175.997 5.748h-3.084l-3.005 5.773-3.006-5.773h-3.084l4.725 8.442v5.397h2.709V14.19l4.745-8.442zM184.461 5.748h-5.16v13.84h2.728V15.04h2.432c2.669 0 4.725-2.056 4.725-4.646s-2.056-4.646-4.725-4.646zm0 6.741h-2.432V8.3h2.432c1.166 0 2.016.889 2.016 2.095 0 1.186-.85 2.095-2.016 2.095zM199.387 19.864c3.994 0 7.196-3.163 7.196-7.197 0-4.053-3.202-7.196-7.196-7.196-3.994 0-7.177 3.143-7.177 7.196 0 4.034 3.183 7.197 7.177 7.197zm0-2.67c-2.511 0-4.468-1.877-4.468-4.527 0-2.669 1.957-4.547 4.468-4.547s4.468 1.878 4.468 4.547c0 2.65-1.957 4.528-4.468 4.528zM224.061 12.153h-6.94v2.412h4.191c-.474 1.582-1.858 2.63-4.033 2.63-2.886 0-4.725-1.938-4.725-4.508 0-2.63 1.898-4.567 4.527-4.567 1.681 0 3.085.81 3.717 1.918l2.333-1.345c-1.166-1.897-3.4-3.222-6.03-3.222-4.132 0-7.256 3.203-7.256 7.216 0 3.954 3.085 7.177 7.414 7.177 3.974 0 6.802-2.65 6.802-6.643v-1.068zM235.57 19.587h2.946l-3.064-5.22c1.581-.73 2.669-2.293 2.669-4.033 0-2.53-2.057-4.586-4.607-4.586h-5.536v13.84h2.729v-4.805h2.076l2.787 4.804zm-4.863-11.289h2.807c1.028 0 1.878.89 1.878 2.037 0 1.146-.85 2.056-1.878 2.056h-2.807V8.298zM250.996 19.587h2.966l-4.864-13.84h-3.38l-4.844 13.84h2.946l.83-2.491h5.516l.83 2.491zm-5.476-5.041l1.898-5.655 1.898 5.655h-3.796zM262.443 5.748h-5.16v13.84h2.728V15.04h2.432c2.669 0 4.725-2.056 4.725-4.646s-2.056-4.646-4.725-4.646zm0 6.741h-2.432V8.3h2.432c1.167 0 2.017.889 2.017 2.095 0 1.186-.85 2.095-2.017 2.095zM278.79 5.748v5.496h-5.14V5.748h-2.728v13.84h2.728v-5.734h5.14v5.733h2.709V5.747h-2.709zM297 5.748h-3.084l-3.005 5.773-3.006-5.773h-3.084l4.725 8.442v5.397h2.709V14.19L297 5.748z"
27
+ ></path>
28
+ </svg>
29
+ </div>
30
+ <div className="mt-8 prose prose-slate mx-auto lg:prose-lg">
31
+ <p className="lead">
32
+ Until now, trying to style an article, document, or blog post with
33
+ Tailwind has been a tedious task that required a keen eye for
34
+ typography and a lot of complex custom CSS.
35
+ </p>
36
+ <p>
37
+ By default, Tailwind removes all of the default browser styling from
38
+ paragraphs, headings, lists and more. This ends up being really
39
+ useful for building application UIs because you spend less time
40
+ undoing user-agent styles, but when you <em>really are</em> just
41
+ trying to style some content that came from a rich-text editor in a
42
+ CMS or a markdown file, it can be surprising and unintuitive.
43
+ </p>
44
+ <p>
45
+ We get lots of complaints about it actually, with people regularly
46
+ asking us things like:
47
+ </p>
48
+ <blockquote>
49
+ <p>
50
+ Why is Tailwind removing the default styles on my <code>h1</code>{" "}
51
+ elements? How do I disable this? What do you mean I lose all the
52
+ other base styles too?
53
+ </p>
54
+ </blockquote>
55
+ <p>
56
+ We hear you, but we&apos;re not convinced that simply disabling our
57
+ base styles is what you really want. You don&apos;t want to have to
58
+ remove annoying margins every time you use a <code>p</code> element
59
+ in a piece of your dashboard UI. And I doubt you really want your
60
+ blog posts to use the user-agent styles either — you want them to
61
+ look <em>awesome</em>, not awful.
62
+ </p>
63
+ <p>
64
+ The <code>@tailwindcss/typography</code> plugin is our attempt to
65
+ give you what you <em>actually</em> want, without any of the
66
+ downsides of doing something stupid like disabling our base styles.
67
+ </p>
68
+ <p>
69
+ It adds a new <code>prose</code> class that you can slap on any
70
+ block of vanilla HTML content and turn it into a beautiful,
71
+ well-formatted document:
72
+ </p>
73
+ <pre>
74
+ <code
75
+ className="language-html"
76
+ dangerouslySetInnerHTML={{
77
+ __html: `&lt;article class="prose"&gt;
78
+ &lt;h1&gt;Garlic bread with cheese: What the science tells us&lt;/h1&gt;
79
+ &lt;p&gt;
80
+ For years parents have espoused the health benefits of eating garlic bread with cheese to their
81
+ children, with the food earning such an iconic status in our culture that kids will often dress
82
+ up as warm, cheesy loaf for Halloween.
83
+ &lt;/p&gt;
84
+ &lt;p&gt;
85
+ But a recent study shows that the celebrated appetizer may be linked to a series of rabies cases
86
+ springing up around the country.
87
+ &lt;/p&gt;
88
+ &lt;!-- ... --&gt;
89
+ &lt;/article&gt;`,
90
+ }}
91
+ />
92
+ </pre>
93
+ <p>
94
+ For more information about how to use the plugin and the features it
95
+ includes,{" "}
96
+ <a href="https://github.com/tailwindcss/typography/blob/master/README.md">
97
+ read the documentation
98
+ </a>
99
+ .
100
+ </p>
101
+ <hr />
102
+ <h2>What to expect from here on out</h2>
103
+ <p>
104
+ What follows from here is just a bunch of absolute nonsense
105
+ I&apos;ve written to dogfood the plugin itself. It includes every
106
+ sensible typographic element I could think of, like{" "}
107
+ <strong>bold text</strong>, unordered lists, ordered lists, code
108
+ blocks, block quotes, <em>and even italics</em>.
109
+ </p>
110
+ <p>
111
+ It&apos;s important to cover all of these use cases for a few
112
+ reasons:
113
+ </p>
114
+ <ol>
115
+ <li>We want everything to look good out of the box.</li>
116
+ <li>
117
+ Really just the first reason, that&apos;s the whole point of the
118
+ plugin.
119
+ </li>
120
+ <li>
121
+ Here&apos;s a third pretend reason though a list with three items
122
+ looks more realistic than a list with two items.
123
+ </li>
124
+ </ol>
125
+ <p>Now we&apos;re going to try out another header style.</p>
126
+ <h3>Typography should be easy</h3>
127
+ <p>
128
+ So that&apos;s a header for you — with any luck if we&apos;ve done
129
+ our job correctly that will look pretty reasonable.
130
+ </p>
131
+ <p>Something a wise person once told me about typography is:</p>
132
+ <blockquote>
133
+ <p>
134
+ Typography is pretty important if you don&apos;t want your stuff
135
+ to look like trash. Make it good then it won&apos;t be bad.
136
+ </p>
137
+ </blockquote>
138
+ <p>
139
+ It&apos;s probably important that images look okay here by default
140
+ as well:
141
+ </p>
142
+ <figure>
143
+ <img
144
+ src="https://images.unsplash.com/photo-1556740758-90de374c12ad?ixlib=rb-1.2.1&amp;ixid=eyJhcHBfaWQiOjEyMDd9&amp;auto=format&amp;fit=crop&amp;w=1000&amp;q=80"
145
+ alt=""
146
+ />
147
+ <figcaption>
148
+ Contrary to popular belief, Lorem Ipsum is not simply random text.
149
+ It has roots in a piece of classical Latin literature from 45 BC,
150
+ making it over 2000 years old.
151
+ </figcaption>
152
+ </figure>
153
+ <p>
154
+ Now I&apos;m going to show you an example of an unordered list to
155
+ make sure that looks good, too:
156
+ </p>
157
+ <ul>
158
+ <li>So here is the first item in this list.</li>
159
+ <li>In this example we&apos;re keeping the items short.</li>
160
+ <li>Later, we&apos;ll use longer, more complex list items.</li>
161
+ </ul>
162
+ <p>And that&apos;s the end of this section.</p>
163
+ <h2>What if we stack headings?</h2>
164
+ <h3>We should make sure that looks good, too.</h3>
165
+ <p>
166
+ Sometimes you have headings directly underneath each other. In those
167
+ cases you often have to undo the top margin on the second heading
168
+ because it usually looks better for the headings to be closer
169
+ together than a paragraph followed by a heading should be.
170
+ </p>
171
+ <h3>When a heading comes after a paragraph …</h3>
172
+ <p>
173
+ When a heading comes after a paragraph, we need a bit more space,
174
+ like I already mentioned above. Now let&apos;s see what a more
175
+ complex list would look like.
176
+ </p>
177
+ <ul>
178
+ <li>
179
+ <p>
180
+ <strong>
181
+ I often do this thing where list items have headings.
182
+ </strong>
183
+ </p>
184
+ <p>
185
+ For some reason I think this looks cool which is unfortunate
186
+ because it&apos;s pretty annoying to get the styles right.
187
+ </p>
188
+ <p>
189
+ I often have two or three paragraphs in these list items, too,
190
+ so the hard part is getting the spacing between the paragraphs,
191
+ list item heading, and separate list items to all make sense.
192
+ Pretty tough honestly, you could make a strong argument that you
193
+ just shouldn&apos;t write this way.
194
+ </p>
195
+ </li>
196
+ <li>
197
+ <p>
198
+ <strong>
199
+ Since this is a list, I need at least two items.
200
+ </strong>
201
+ </p>
202
+ <p>
203
+ I explained what I&apos;m doing already in the previous list
204
+ item, but a list wouldn&apos;t be a list if it only had one
205
+ item, and we really want this to look realistic. That&apos;s why
206
+ I&apos;ve added this second list item so I actually have
207
+ something to look at when writing the styles.
208
+ </p>
209
+ </li>
210
+ <li>
211
+ <p>
212
+ <strong>
213
+ It&apos;s not a bad idea to add a third item either.
214
+ </strong>
215
+ </p>
216
+ <p>
217
+ I think it probably would&apos;ve been fine to just use two
218
+ items but three is definitely not worse, and since I seem to be
219
+ having no trouble making up arbitrary things to type, I might as
220
+ well include it.
221
+ </p>
222
+ </li>
223
+ </ul>
224
+ <p>
225
+ After this sort of list I usually have a closing statement or
226
+ paragraph, because it kinda looks weird jumping right to a heading.
227
+ </p>
228
+ <h2>Code should look okay by default.</h2>
229
+ <p>
230
+ I think most people are going to use{" "}
231
+ <a href="https://highlightjs.org/">highlight.js</a> or{" "}
232
+ <a href="https://prismjs.com/">Prism</a> or something if they want
233
+ to style their code blocks but it wouldn&apos;t hurt to make them
234
+ look <em>okay</em> out of the box, even with no syntax highlighting.
235
+ </p>
236
+ <p>
237
+ Here&apos;s what a default <code>tailwind.config.js</code> file
238
+ looks like at the time of writing:
239
+ </p>
240
+ <pre>
241
+ <code className="language-js">
242
+ {`module.exports = {
243
+ purge: [],
244
+ theme: {
245
+ extend: {},
246
+ },
247
+ variants: {},
248
+ plugins: [],
249
+ }`}
250
+ </code>
251
+ </pre>
252
+ <p>Hopefully that looks good enough to you.</p>
253
+ <h3>What about nested lists?</h3>
254
+ <p>
255
+ Nested lists basically always look bad which is why editors like
256
+ Medium don&apos;t even let you do it, but I guess since some of you
257
+ goofballs are going to do it we have to carry the burden of at least
258
+ making it work.
259
+ </p>
260
+ <ol>
261
+ <li>
262
+ <strong>Nested lists are rarely a good idea.</strong>
263
+ <ul>
264
+ <li>
265
+ You might feel like you are being really
266
+ &ldquo;organized&rdquo; or something but you are just creating
267
+ a gross shape on the screen that is hard to read.
268
+ </li>
269
+ <li>
270
+ Nested navigation in UIs is a bad idea too, keep things as
271
+ flat as possible.
272
+ </li>
273
+ <li>
274
+ Nesting tons of folders in your source code is also not
275
+ helpful.
276
+ </li>
277
+ </ul>
278
+ </li>
279
+ <li>
280
+ <strong>
281
+ Since we need to have more items, here&apos;s another one.
282
+ </strong>
283
+ <ul>
284
+ <li>
285
+ I&apos;m not sure if we&apos;ll bother styling more than two
286
+ levels deep.
287
+ </li>
288
+ <li>
289
+ Two is already too much, three is guaranteed to be a bad idea.
290
+ </li>
291
+ <li>If you nest four levels deep you belong in prison.</li>
292
+ </ul>
293
+ </li>
294
+ <li>
295
+ <strong>
296
+ Two items isn&apos;t really a list, three is good though.
297
+ </strong>
298
+ <ul>
299
+ <li>
300
+ Again please don&apos;t nest lists if you want people to
301
+ actually read your content.
302
+ </li>
303
+ <li>Nobody wants to look at this.</li>
304
+ <li>
305
+ I&apos;m upset that we even have to bother styling this.
306
+ </li>
307
+ </ul>
308
+ </li>
309
+ </ol>
310
+ <p>
311
+ The most annoying thing about lists in Markdown is that{" "}
312
+ <code>&lt;li&gt;</code> elements aren&apos;t given a child{" "}
313
+ <code>&lt;p&gt;</code> tag unless there are multiple paragraphs in
314
+ the list item. That means I have to worry about styling that
315
+ annoying situation too.
316
+ </p>
317
+ <ul>
318
+ <li>
319
+ <p>
320
+ <strong>For example, here&apos;s another nested list.</strong>
321
+ </p>
322
+ <p>But this time with a second paragraph.</p>
323
+ <ul>
324
+ <li>
325
+ These list items won&apos;t have <code>&lt;p&gt;</code> tags
326
+ </li>
327
+ <li>Because they are only one line each</li>
328
+ </ul>
329
+ </li>
330
+ <li>
331
+ <p>
332
+ <strong>
333
+ But in this second top-level list item, they will.
334
+ </strong>
335
+ </p>
336
+ <p>
337
+ This is especially annoying because of the spacing on this
338
+ paragraph.
339
+ </p>
340
+ <ul>
341
+ <li>
342
+ <p>
343
+ As you can see here, because I&apos;ve added a second line,
344
+ this list item now has a <code>&lt;p&gt;</code> tag.
345
+ </p>
346
+ <p>
347
+ This is the second line I&apos;m talking about by the way.
348
+ </p>
349
+ </li>
350
+ <li>
351
+ <p>
352
+ Finally here&apos;s another list item so it&apos;s more like
353
+ a list.
354
+ </p>
355
+ </li>
356
+ </ul>
357
+ </li>
358
+ <li>
359
+ <p>
360
+ A closing list item, but with no nested list, because why not?
361
+ </p>
362
+ </li>
363
+ </ul>
364
+ <p>And finally a sentence to close off this section.</p>
365
+ <h2>There are other elements we need to style</h2>
366
+ <p>
367
+ I almost forgot to mention links, like{" "}
368
+ <a href="https://tailwindcss.com">
369
+ this link to the Tailwind CSS website
370
+ </a>
371
+ . We almost made them blue but that&apos;s so yesterday, so we went
372
+ with dark gray, feels edgier.
373
+ </p>
374
+ <p>We even included table styles, check it out:</p>
375
+ <table>
376
+ <thead>
377
+ <tr>
378
+ <th>Wrestler</th>
379
+ <th>Origin</th>
380
+ <th>Finisher</th>
381
+ </tr>
382
+ </thead>
383
+ <tbody>
384
+ <tr>
385
+ <td>Bret &ldquo;The Hitman&rdquo; Hart</td>
386
+ <td>Calgary, AB</td>
387
+ <td>Sharpshooter</td>
388
+ </tr>
389
+ <tr>
390
+ <td>Stone Cold Steve Austin</td>
391
+ <td>Austin, TX</td>
392
+ <td>Stone Cold Stunner</td>
393
+ </tr>
394
+ <tr>
395
+ <td>Randy Savage</td>
396
+ <td>Sarasota, FL</td>
397
+ <td>Elbow Drop</td>
398
+ </tr>
399
+ <tr>
400
+ <td>Vader</td>
401
+ <td>Boulder, CO</td>
402
+ <td>Vader Bomb</td>
403
+ </tr>
404
+ <tr>
405
+ <td>Razor Ramon</td>
406
+ <td>Chuluota, FL</td>
407
+ <td>Razor&apos;s Edge</td>
408
+ </tr>
409
+ </tbody>
410
+ </table>
411
+ <p>
412
+ We also need to make sure inline code looks good, like if I wanted
413
+ to talk about <code>&lt;span&gt;</code> elements or tell you the
414
+ good news about <code>@tailwindcss/typography</code>.
415
+ </p>
416
+ <h3>
417
+ Sometimes I even use <code>code</code> in headings
418
+ </h3>
419
+ <p>
420
+ Even though it&apos;s probably a bad idea, and historically
421
+ I&apos;ve had a hard time making it look good. This{" "}
422
+ <em>&ldquo;wrap the code blocks in backticks&rdquo;</em> trick works
423
+ pretty well though really.
424
+ </p>
425
+ <p>
426
+ Another thing I&apos;ve done in the past is put a <code>code</code>{" "}
427
+ tag inside of a link, like if I wanted to tell you about the{" "}
428
+ <a href="https://github.com/tailwindcss/docs">
429
+ <code>tailwindcss/docs</code>
430
+ </a>{" "}
431
+ repository. I don&apos;t love that there is an underline below the
432
+ backticks but it is absolutely not worth the madness it would
433
+ require to avoid it.
434
+ </p>
435
+ <h4>
436
+ We haven&apos;t used an <code>h4</code> yet
437
+ </h4>
438
+ <p>
439
+ But now we have. Please don&apos;t use <code>h5</code> or{" "}
440
+ <code>h6</code> in your content, Medium only supports two heading
441
+ levels for a reason, you animals. I honestly considered using a{" "}
442
+ <code>before</code> pseudo-element to scream at you if you use an{" "}
443
+ <code>h5</code> or <code>h6</code>.
444
+ </p>
445
+ <p>
446
+ We don&apos;t style them at all out of the box because{" "}
447
+ <code>h4</code> elements are already so small that they are the same
448
+ size as the body copy. What are we supposed to do with an{" "}
449
+ <code>h5</code>, make it <em>smaller</em> than the body copy? No
450
+ thanks.
451
+ </p>
452
+ <h3>We still need to think about stacked headings though.</h3>
453
+ <h4>
454
+ Let&apos;s make sure we don&apos;t screw that up with{" "}
455
+ <code>h4</code> elements, either.
456
+ </h4>
457
+ <p>
458
+ Phew, with any luck we have styled the headings above this text and
459
+ they look pretty good.
460
+ </p>
461
+ <p>
462
+ Let&apos;s add a closing paragraph here so things end with a
463
+ decently sized block of text. I can&apos;t explain why I want things
464
+ to end that way but I have to assume it&apos;s because I think
465
+ things will look weird or unbalanced if there is a heading too close
466
+ to the end of the document.
467
+ </p>
468
+ <p>
469
+ What I&apos;ve written here is probably long enough, but adding this
470
+ final sentence can&apos;t hurt.
471
+ </p>
472
+ </div>
473
+ </div>
474
+ </div>
475
+ );
476
+ };
@@ -0,0 +1,34 @@
1
+ export const TypographyScale = () => {
2
+ return (
3
+ <div className="prose">
4
+ <h1>h1. Heading</h1>
5
+ <h2>h2. Heading</h2>
6
+ <h3>h3. Heading</h3>
7
+ <h4>h4. Heading</h4>
8
+
9
+ <sup>superscript text</sup>
10
+ <span>Normal text here</span>
11
+ <sub>subscript text</sub>
12
+
13
+ <p>
14
+ Paragraph. Lorem ipsum dolor sit amet, consectetur adipisicing elit.
15
+ Quos blanditiis tenetur unde suscipit, quam beatae rerum inventore
16
+ consectetur, neque doloribus, cupiditate numquam dignissimos laborum
17
+ fugiat deleniti? Eum quasi quidem quibusdam.
18
+ </p>
19
+
20
+ <button type="button">Primary button text</button>
21
+ <blockquote>
22
+ Blockquote: Lorem ipsum dolor sit amet, consectetur adipisicing elit.
23
+ Quos blanditiis tenetur unde suscipit, quam beatae
24
+ </blockquote>
25
+ <dl>
26
+ <dt>Description term</dt>
27
+ <dd>
28
+ Description detail: Lorem ipsum dolor sit amet, consectetur
29
+ adipisicing elit. Quos blanditiis tenetur unde suscipit, quam beatae
30
+ </dd>
31
+ </dl>
32
+ </div>
33
+ );
34
+ };