Skip to content

Commit 5975781

Browse files
committed
WIP
1 parent 4646153 commit 5975781

File tree

5 files changed

+608
-321
lines changed

5 files changed

+608
-321
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.next
22
node_modules
3-
package-lock.json
3+
package-lock.json
4+
/docs/out

docs/components/MarkdownSample.mdx

+21-18
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ module.exports = {
8585
extend: {},
8686
},
8787
variants: {},
88-
plugins: [
89-
require('../src/index.js'),
90-
],
88+
plugins: [require('../src/index.js')],
9189
}
9290
```
9391

@@ -98,37 +96,42 @@ Hopefully that looks good enough to you.
9896
Nested lists basically always look bad which is why editors like Medium don't even let you do it, but I guess since some of you goofballs are going to do it I have to carry the burden of at least making it work.
9997

10098
1. **Nested lists are rarely a good idea.**
101-
+ You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read.
102-
+ Nested navigation in UIs is a bad idea too, keep things as flat as possible.
103-
+ Nesting tons of folders in your source code is also not helpful.
99+
- You might feel like you are being really "organized" or something but you are just creating a gross shape on the screen that is hard to read.
100+
- Nested navigation in UIs is a bad idea too, keep things as flat as possible.
101+
- Nesting tons of folders in your source code is also not helpful.
104102
2. **Since we need to have more items, here's another one.**
105-
+ I'm not sure if I'll bother styling more than two levels deep.
106-
+ Two is already too much, three is guaranteed to be a bad idea.
107-
+ If you nest four levels deep you belong in prison.
103+
- I'm not sure if I'll bother styling more than two levels deep.
104+
- Two is already too much, three is guaranteed to be a bad idea.
105+
- If you nest four levels deep you belong in prison.
108106
3. **Two items isn't really a list, three is good though.**
109-
+ Again please don't nest lists if you want people to actually read your content.
110-
+ Nobody wants to look at this.
111-
+ I'm upset that I even have to bother styling this.
107+
- Again please don't nest lists if you want people to actually read your content.
108+
- Nobody wants to look at this.
109+
- I'm upset that I even have to bother styling this.
112110

113111
The most annoying thing about lists in Markdown is that `<li>` elements aren't given a child `<p>` tag unless there are multiple paragraphs in the list item. That means I have to worry about styling that annoying situation too.
114112

115113
- **For example, here's another nested list.**
116114

117115
But this time with a second paragraph.
118-
- These list items won't have `<p>` tags
119-
- Because they are only one line each
116+
117+
- These list items won't have `<p>` tags
118+
- Because they are only one line each
119+
120120
- **But in this second top-level list item, they will.**
121121

122122
This is especially annoying because of the spacing on this paragraph.
123-
- As you can see here, because I've added a second line, this list item now has a `<p>` tag.
124123

125-
This is the second line I'm talking about by the way.
126-
- Finally here's another list item so it's more like a list.
124+
- As you can see here, because I've added a second line, this list item now has a `<p>` tag.
125+
126+
This is the second line I'm talking about by the way.
127+
128+
- Finally here's another list item so it's more like a list.
129+
127130
- A closing list item, but with no nested list, because why not?
128131

129132
And finally a sentence to close off this section.
130133

131-
## There are other elements we need to style
134+
## There are other `elements` we need to style
132135

133136
I almost forgot to style links, like [this link to the Tailwind CSS website](https://tailwindcss.com). How should those look by default, blue I guess? I dunno.
134137

docs/pages/index.js

+25-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
1+
import { useState } from 'react'
12
import Layout from '../components/Layout'
23
import MarkdownSample from '../components/MarkdownSample.mdx'
34

4-
export default () => (
5-
<Layout meta={{ title: 'Tailwind CSS Typography' }}>
6-
<div className="prose mx-auto">
7-
<MarkdownSample />
8-
</div>
9-
</Layout>
10-
)
5+
export default () => {
6+
const [size, setSize] = useState('default')
7+
8+
return (
9+
<Layout meta={{ title: 'Tailwind CSS Typography' }}>
10+
<div className="fixed top-0 left-0 flex flex-col ml-3">
11+
{['default', 'sm', 'lg', 'xl'].map((s) => (
12+
<button
13+
type="button"
14+
className={`border mt-3 px-4 focus:outline-none ${
15+
size === s ? 'border-black' : ''
16+
}`}
17+
onClick={() => setSize(s)}
18+
>
19+
{s}
20+
</button>
21+
))}
22+
</div>
23+
<div className={`prose prose-${size} mx-auto`}>
24+
<MarkdownSample />
25+
</div>
26+
</Layout>
27+
)
28+
}

docs/tailwind.config.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
module.exports = {
22
theme: {
3-
extend: {},
3+
typography: {
4+
default: {
5+
// bulletColor: 'red',
6+
css: {},
7+
},
8+
},
49
},
510
variants: {},
6-
plugins: [
7-
require('../src/index.js'),
8-
],
11+
plugins: [require('../src/index.js')],
912
}

0 commit comments

Comments
 (0)