348 Commits

Author SHA1 Message Date
Adam Wathan
fb451e7aa6 Update font-size and font-weight to inherit 2019-03-02 13:05:39 -05:00
Adam Wathan
c3886066cc Reset heading styles in preflight
Set all headings to inherit the parent font size and reset the font
weight to normal. This prevents you from accidentally using browser
default sizes in your designs and deviating from your design system.
2019-03-01 20:53:01 -05:00
Adam Wathan
1ea1f4a450 Add 40/48/56/64 to shared spacing scale 2019-03-01 13:41:47 -05:00
Adam Wathan
1c5940ee88 Add 56 value for width/height 2019-03-01 13:27:56 -05:00
Adam Wathan
e99753bc33 Update plugins to source their config themselves
Instead of plugins being configured directly, they grab their configuration from the Tailwind config passed to them. This makes core plugins consistent with how we will recommend third-party plugins be authored so that the configuration for everything in the system is readable through the theme.
2019-02-28 14:53:55 -05:00
Adam Wathan
51e60071cf Fix test 2019-02-28 14:39:59 -05:00
Adam Wathan
8cf5bc1537
Merge pull request #695 from tailwindcss/manually-escape-variants
Require plugin authors to manually escape variants
2019-02-28 11:11:45 -05:00
Adam Wathan
007231fbfc Require plugin authors to manually escape variants
Not 100% convinced this is a net positive change, but I regret not having done things this way at the beginning.

In 0.x, we pass the `separator` and `className` values already escaped, so `:` comes through as `\:` for example, and `w-1/2` comes through as `w-1\/2`.

At first this sounds fine, less work for the plugin author right? But CSS escaping rules are kind of complicated and you have to escape characters differently depending on whether or not they are at the start of an identifier.

For example, it's totally fine for a class to contain a zero (`0` ), but it can't _start_ with a zero. For a class to start with a zero, it needs to be escaped like this: `\30 `

This means that as a general rule, trying to escape the individual segments of a class separately is a bad idea — you should escape the class as a whole so only the necessary escaping is applied. We break this rule when we pre-escape the separator and className for plugin authors who use the `modifySelectors` function.

We already require users to manually escape class names when they are using `addUtilities` or `addComponents`, so to me it feels more consistent for things to work this way and it's how they should have worked from day one.

Basically this code:

```js
function({ addVariant }) {
  addVariant('first-child', ({ modifySelectors, separator }) => {
    modifySelectors(({ className }) => {
      return `.first-child${separator}${className}:first-child`
    })
  })
},
```

...would need to be re-written like this if I merge this change:

```js
function({ addVariant, e }) {
  addVariant('first-child', ({ modifySelectors, separator }) => {
    modifySelectors(({ className }) => {
      return `.${e(`first-child${separator}${className}`)}:first-child`
    })
  })
},
```

Although I think this is the right way for this to work, I hesitate because it's a breaking change that makes any variant plugins authored for 0.x incompatible with 1.x. It's an easy fix on the plugin author's part, but it's still annoying.

I'm leaning towards merging so I don't regret this even more later when the plugin ecosystem is a lot bigger. Anyone have any thoughts?
2019-02-28 10:17:09 -05:00
Adam Wathan
92d3bcfa6a Update shadows to incorporate progressive negative spread 2019-02-28 07:46:26 -05:00
Adam Wathan
361ffb6a2c Update fixtures 2019-02-27 20:31:53 -05:00
Adam Wathan
2b89e09409 Split flexShrink to separate plugin 2019-02-26 10:33:34 -05:00
Adam Wathan
06ef9557b3 Split flexGrow to separate plugin 2019-02-26 10:30:44 -05:00
Adam Wathan
10106e2edc Move flex display utilities to display plugin 2019-02-26 10:02:25 -05:00
Adam Wathan
d0de252e47 Rename flex-no-grow/shrink to flex-grow/shrink-0 2019-02-26 09:13:17 -05:00
Adam Wathan
2e1099ebea Update default breakpoints 2019-02-22 21:20:22 -05:00
Adam Wathan
2c5c54367c
Merge pull request #681 from hacknug/feature/word-wrapping
Add new word-break utilities
2019-02-22 12:37:44 -05:00
Nestor Vera
85957755dd Add new word-break utilities 2019-02-22 17:51:21 +01:00
Nestor Vera
233d5bdcbd Fix undefined var in one test 2019-02-22 16:59:56 +01:00
Adam Wathan
db7f1e6728 Merge branch 'master' into next 2019-02-22 10:05:31 -05:00
Adam Wathan
10aa36533f Pass postcss to plugins explicitly 2019-02-22 09:50:36 -05:00
Adam Wathan
48b72304cb
Merge pull request #640 from MattStypa/build_refactor
CLI build process improvements
2019-02-21 15:08:12 -05:00
Adam Wathan
fdc5565f70
Merge pull request #671 from tailwindcss/extend-tracking-scale
Extend letter-spacing scale
2019-02-21 15:03:37 -05:00
Adam Wathan
e5134752d8 Add snug and relaxed line-heights 2019-02-20 19:41:55 -05:00
Adam Wathan
62c5addc4b Extend letter-spacing scale 2019-02-20 14:44:19 -05:00
Adam Wathan
e5d2e6429d Enable object fit/position plugins by default 2019-02-19 18:59:12 -05:00
Adam Wathan
3f9c4ec84b Rename roman to not-italic 2019-02-18 10:14:15 -05:00
Adam Wathan
87192f8922 Fix conflicts 2019-02-18 09:39:38 -05:00
Adam Wathan
c029fff479 Update width and height to share spacing values 2019-02-16 20:53:35 -05:00
Adam Wathan
3797220c44 Extract padding/margin values to spacing 2019-02-16 20:33:05 -05:00
Adam Wathan
c2f62c1c6c Split textStyle plugin into one plugin per CSS property 2019-02-15 16:12:49 -05:00
Adam Wathan
4763840582 Merge branch 'master' into next 2019-02-15 14:31:17 -05:00
Adam Wathan
c0ec2c5fbe Allow users to customize default variant placement 2019-02-15 10:52:01 -05:00
Adam Wathan
c56b56db3e Fix code style 2019-02-14 07:48:57 -05:00
Adam Wathan
e1dd08dad3 Add test to document extend is not deeply merged 2019-02-14 07:43:50 -05:00
Adam Wathan
d95d28eec8 Fix code style 2019-02-13 14:25:37 -05:00
Adam Wathan
8ff2b59096 Add first class support for extending the default theme 2019-02-13 13:07:41 -05:00
Adam Wathan
690c7f2d52 Convert preflight to plugin 2019-02-07 15:19:54 -05:00
Adam Wathan
76c40e4394 Fix style 2019-02-07 15:13:17 -05:00
Adam Wathan
4007fc4d32 Test plugins can add base styles with raw PostCSS nodes 2019-02-07 14:06:24 -05:00
Adam Wathan
1d0b4cd31c Test plugins can add base styles with object syntax 2019-02-07 14:05:00 -05:00
Adam Wathan
b8f965179c Finish merge of master 2019-02-07 13:58:47 -05:00
Adam Wathan
b544febfcb Use root instead of array to unify code paths 2019-02-06 14:23:38 -05:00
Adam Wathan
faf2be163f Add failing test for using @responsive with deeply nested at-rules 2019-02-06 13:56:58 -05:00
Adam Wathan
04e1274e86 Rename mergeConfig to resolveConfig
Accept configs to resolve as an array to allow reuse when only resolving from a single config, update processTailwindFeatures to use resolveConfig even when no config is provided, update defaultTheme to self-reference colors.
2019-02-05 20:36:54 -05:00
Adam Wathan
40413690a2 Add support for lazy values in theme 2019-02-05 20:18:19 -05:00
Adam Wathan
44bccca3d0 Fix code style 2019-02-05 13:37:05 -05:00
Adam Wathan
4c2be2ac2c Test custom core plugin config overrides default core plugin config 2019-02-05 11:00:43 -05:00
Adam Wathan
4afb9e45e6 Test core plugins fall back to a default config 2019-02-05 10:58:56 -05:00
Adam Wathan
c84b188626 Fix code style 2019-02-05 10:54:35 -05:00
Adam Wathan
b5806c8437 Test overriding a core plugin's config 2019-02-05 10:54:06 -05:00