Skip to content
This repository was archived by the owner on Sep 11, 2021. It is now read-only.

Commit a6e5abb

Browse files
committed
Add basic configuration instructions to demo/docs
1 parent 80235d9 commit a6e5abb

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

docs/pages/index.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import dedent from 'dedent'
12
import CodeSample from '../components/CodeSample'
23
import Layout from '../components/Layout'
4+
import Highlight from 'react-highlight'
35

46
export default Layout
57

@@ -23,6 +25,49 @@ unopinionated, and easy to customize by adding utilities instead of having to wr
2325

2426
---
2527

28+
## Configuration
29+
30+
You can customize any of the default form styles applied by this plugin using the `theme.customForms`
31+
section of your `tailwind.config.js` file.
32+
33+
Here is a list of the all of the available options, as well as their default values:
34+
35+
<div className="rounded-b-lg p-4 bg-gray-800">
36+
<Highlight className="language-js">{dedent`
37+
// tailwind.config.js
38+
const defaultTheme = require('tailwindcss/defaultTheme')\n
39+
module.exports = {
40+
theme: {
41+
customForms: {
42+
horizontalPadding: defaultTheme.spacing[3],
43+
verticalPadding: defaultTheme.spacing[2],
44+
lineHeight: defaultTheme.lineHeight.normal,
45+
fontSize: defaultTheme.fontSize.base,
46+
borderColor: defaultTheme.borderColor.default,
47+
borderWidth: defaultTheme.borderWidth.default,
48+
borderRadius: defaultTheme.borderRadius.default,
49+
backgroundColor: defaultTheme.colors.white,
50+
focusBorderColor: defaultTheme.colors.blue[400],
51+
focusShadow: defaultTheme.boxShadow.outline,
52+
checkboxSize: '1em',
53+
radioSize: '1em',
54+
checkboxIcon: \`<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="#fff"><path d="M13.293 4.293a1 1 0 0 1 0 1.414L7 12a1 1 0 0 1-1.414 0L3.293 9.707a1 1 0 0 1 1.414-1.414l1.586 1.586 5.586-5.586a1 1 0 0 1 1.414 0z"/></svg>\`,
55+
radioIcon: \`<svg viewBox="0 0 24 24" fill="#fff" xmlns="http://www.w3.org/2000/svg"><circle cx="12" cy="12" r="5"/></svg>\`,
56+
checkedColor: 'currentColor',
57+
selectIcon: \`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="\${defaultTheme.colors.gray[500]}"><path d="M15.3 9.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z"/></svg>\`,
58+
selectIconOffset: defaultTheme.spacing[2],
59+
selectIconSize: '1.5em',
60+
}
61+
},
62+
plugins: [
63+
require('@tailwindcss/custom-forms'),
64+
],
65+
}
66+
`}</Highlight>
67+
</div>
68+
69+
---
70+
2671
## Text Input
2772

2873
Add basic styles to a normal `input` element using the `form-input` class.

docs/static/css/tailwind.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
border-radius: theme('borderRadius.lg');
4747
}
4848
.hljs-comment, .hljs-quote {
49-
color: theme('colors.gray-500');
49+
color: theme('colors.gray.500');
5050
font-style: italic;
5151
}
5252
.hljs-name {

0 commit comments

Comments
 (0)