Adam Wathan
326f35a72a
Remove options key from config
2019-02-01 12:32:50 -05:00
Adam Wathan
e8d16fcdb5
Move separator to top level config option
2019-02-01 12:32:50 -05:00
Adam Wathan
1a46f6b47d
Move important to top level option
2019-02-01 12:32:50 -05:00
Adam Wathan
664f923312
Move prefix option to top-level in config
2019-02-01 12:32:16 -05:00
Adam Wathan
ffae87148d
Revert "Allow plugins to register new config variables"
2019-02-01 12:32:04 -05:00
Adam Wathan
5ea8bbe798
Allow plugins to register new config variables
2019-02-01 12:32:04 -05:00
Adam Wathan
057b4ea767
More dead code discovered and deleted
2019-01-14 15:43:12 -05:00
Adam Wathan
b948c25499
Delete possibly last remnants of dead code
2019-01-14 15:43:12 -05:00
Adam Wathan
fe1b30b2d2
Remove prefixTree, update relevant tests
2019-01-14 15:43:12 -05:00
Adam Wathan
ca524ef7c2
Remove more dead code
2019-01-14 15:43:12 -05:00
Adam Wathan
6352843cde
Port zIndex module to default plugin
2019-01-14 15:43:12 -05:00
Adam Wathan
146b984617
Accept plugins as separate processPlugins arg
2019-01-14 15:43:12 -05:00
Adam Wathan
cc9c91a60a
Delete unused variant modules
2019-01-14 15:39:51 -05:00
Adam Wathan
2b5358d92a
Update prefixSelector for latest selector parser
2019-01-14 14:45:01 -05:00
Adam Wathan
e1d276468b
Get tests passing with updated dependencies
...
Latest postcss-selector-parser tries to be more intelligent about handling escape sequences for you. This is awesome! But our original code was handling escaping ourselves, so this change gets the tests passing for now, with the intent to stop doing escaping ourselves in the near future and instead rely on postcss-selector-parser to handle it for us, since I'm positive their implementation is significantly more robust.
2019-01-14 14:45:01 -05:00
Adam Wathan
76691a563d
Allow modules: [...variants] syntax to bulk apply variants
2018-11-01 21:33:42 -04:00
Adam Wathan
655963a100
Apply all first-class variants using modules: all
2018-11-01 20:30:48 -04:00
SpiltCoffee
38ac38cf99
Fixed linting error
2018-09-15 13:07:29 +10:00
SpiltCoffee
002a4ba90d
Changed Variant Generation to apply per selector in a ruleset ( fixes #530 )
2018-09-15 11:38:58 +10:00
Adam Wathan
1a9b87f085
Fix style
2018-07-12 11:02:13 -04:00
Adam Wathan
80baf4aa17
Pass generated utilities around as array instead of root
...
When you do something like container.before(someRoot), PostCSS actually *mutates* someRoot, leaving it empty and moving its contents before the container. container.before(arrayOfNodes) on the other hand does no weird mutation.
This PR makes sure generatedUtilities is an array of nodes instead of a PostCSS container to avoid this unexpected mutation. It makes it a bit more work to walk those nodes if they need to be transformed, but I think it's worth the trade-off. Can always write a helper function around that if the boilerplate starts to feel repetitive.
2018-07-11 19:14:33 -04:00
Adam Wathan
cfe492220c
Refactor duplication
2018-07-11 11:45:45 -04:00
Adam Wathan
f974b8df03
Add support for writing variant plugins with raw PostCSS API
2018-06-26 13:44:47 -04:00
Adam Wathan
64cda2f44b
Refactor duplication to use generateVariantFunction
2018-06-26 13:44:47 -04:00
Adam Wathan
d77bc055ee
Support for basic variant generator plugins
...
Allows you to write a plugin that registers a new variant but only
allows you to modify the selector (like what our built-in generators
do.)
Next steps are to support variants that wrap rules with at-rules
(like @supports for example), variants that can modify properties
(as opposed to just selectors), and to give variant plugin authors
control over how responsive variants interact with their own variants.
2018-06-26 13:44:47 -04:00
Adam Wathan
9eca69ad83
Refactor process plugins to return an object
2018-06-26 13:44:47 -04:00
Adam Wathan
8333d46cae
Add variant prefix to last class in a selector, not the first
2018-06-20 12:21:14 -04:00
Adam Wathan
1de2a24eb3
Switch to more robust existing CSS escaping library
2018-06-04 09:14:38 -04:00
Adam Wathan
8e8f47c58d
Respect user prefix by default when creating component classes
2018-03-07 09:37:01 -05:00
Adam Wathan
7d589dd542
Fix style + kill unused code
2018-03-07 09:37:01 -05:00
Adam Wathan
c3f021a0c9
Prefix all classes in a selector, don't assume single class
2018-03-07 09:37:01 -05:00
Adam Wathan
d1423bab63
Drop shitty rule/atRule syntax for pure object syntax
2018-03-07 09:37:01 -05:00
Adam Wathan
10be05a167
Get object style parsing working without the insanity
2018-03-07 09:37:01 -05:00
Adam Wathan
6450748351
WIP
2018-03-07 09:37:01 -05:00
Adam Wathan
2feac441e7
Style fixes
2018-03-05 09:58:35 -05:00
Adam Wathan
9234df388e
Add utility helper for creating utility rules that are automatically escaped and respect prefix/important options
2018-03-05 09:58:35 -05:00
Adam Wathan
dac591198f
Provide a function for prefixing utilities in plugins
2018-03-05 09:58:35 -05:00
Adam Wathan
87b291a258
Test utilities can be added without specifying variants
2018-03-05 09:58:35 -05:00
Adam Wathan
9573024a1b
Expose config as a function to avoid mutation and make it easy to provide defaults
2018-03-05 09:58:35 -05:00
Adam Wathan
18d45b19cf
Fix style
2018-03-05 09:58:35 -05:00
Adam Wathan
98f322920f
Move processPlugins to separate module
2018-03-05 09:58:35 -05:00
Adam Wathan
d9bc4e658a
Always use function for determining prefixes internally
2018-01-30 07:12:30 -05:00
Emil Tholin
357c87376e
Add support for passing a function as the prefix
2018-01-28 15:55:21 -05:00
Adam Wathan
858b725896
[0.3] Rename parent-hover to group-hover ( #271 )
2017-12-01 08:14:58 -05:00
Adam Wathan
ad48de9500
[0.3] Escape separator string ( #270 )
2017-11-30 15:55:06 -05:00
Adam Wathan
ec19740eb0
Add support for hardcore bloat mode with modules: 'all'
...
Turns on every variant for every module :feelsgood:
2017-11-29 09:38:59 -05:00
Adam Wathan
f84507457f
Extract mergeConfigWithDefaults for easier testability
2017-11-24 12:34:09 -05:00
Adam Wathan
1a5c09c14d
Fix style
2017-11-23 15:03:34 -05:00
Adam Wathan
936a4eeefd
Extract function for generating modules
...
Fully parameterized, makes it easy to test module options behavior
without testing against the entire default module list.
2017-11-23 15:00:52 -05:00
Adam Wathan
0a6c4cc5c6
Use @variants to generate variants specified in config
...
...instead of using variant generators directly.
2017-11-23 12:01:04 -05:00