1+ import dedent from ' dedent'
12import CodeSample from ' ../components/CodeSample'
23import Layout from ' ../components/Layout'
4+ import Highlight from ' react-highlight'
35
46export 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
2873Add basic styles to a normal ` input ` element using the ` form-input ` class.
0 commit comments