Commit Graph

24 Commits (master)

Author SHA1 Message Date
Ika 4af3dd4b07
test: improve snapshots (#5521)
- before
  ```
  ${input}${"~".repeat(printWidth)}
  ${output}
  ```
- after
  ```
  ===options===
  ${options}
  ${" ".repeat(printWidth)}| printWidth
  ====input====
  ${input}
  ===output====
  ${output}
  =============
  ```
2018-11-25 16:21:14 +08:00
Simen Bekkhus 51b7c02e12 Upgrade jest to 22 (#4782)
* chore: upgrade Jest

* chore: update snapshots

* chore: lock down babel dependency using invalid syntax

* 2 args to test.skip

* use jest 22 for now

* Revert "2 args to test.skip"

This reverts commit 691fdc3f99e320f2303958f2b503f7b4c93fa455.

* remove snapshot name from matcher

* fix standalone tests skips
2018-07-03 03:06:29 -03:00
Evilebot Tnawi 3d60871458
fix: output color adjusters (#4494) 2018-05-29 15:24:38 +03:00
Evilebot Tnawi f5e74cd70a
fix(css): at rules improve formatting and tests (#3828) 2018-02-02 18:06:47 +03:00
Evilebot Tnawi b2e8c6d374 feat: remove extra spaces in attribute selector (#3794) 2018-01-23 10:30:20 -05:00
Lucas Duailibe f119d4a90f
Change run_spec to have explicit parser list (#3356) 2017-11-30 03:31:52 -03:00
Simon Lydell c6bac7cfe6 Split Less and SCSS parsing into different parsers (#2844)
* Split Less and SCSS parsing into different parsers

Now, .less files are always parsed with postcss-less, and .scss files
areare always parsed with postcss-scss. This:

- Is less hacky.
- Is meant to avoid issues like #2829.
- Is probably more performant.

`parser: "postcss"` and `--parser postcss` continue to work like before:
First trying postcss-less, and if that fails, postcss-scss, unless a
regex says that we should try in the opposite order. The new values for
the parser option are "postcss-less" and "postcss-scss".

* Remove postcss from package.json since it is not used

* Rename parser-less to less and parser-scss to scss

* Deprecate parser:postcss in favor of parser:css

* Fix CSS tests
2017-09-26 07:08:11 +02:00
Simon Lydell 368522cf33 Normalize CSS case (#2736)
Fixes #2653.
2017-09-03 21:22:28 +02:00
Simon Lydell e5f84467b7 Normalize numbers in CSS like JS
Unlike JS, `1.0` is also normalized to `1`.
2017-08-22 18:50:10 +02:00
Simon Lydell 4979f58c15 Normalize quotes in CSS like in JS 2017-08-14 09:14:57 +02:00
Christopher Chedeau 08060e7c94 Use fill for CSS values (#2224)
This looks less weird to have them flow as they fit than breaking on every single line.

Fixes #2213
2017-06-21 15:13:51 -07:00
Christopher Chedeau 313519d8ae Allow long media rules to break (#2219)
Fixes #2198
2017-06-21 13:02:16 -07:00
Lucas Azzola 43521565e7 CSS: lowercase hex colors, closes #2139 (#2203) 2017-06-20 23:07:31 +10:00
Pier Paolo Ramon 126727380d CSS: Every selector is now printed in its own line (#2047)
Changes the behaviour for line breaking inside selector lists (those
separated by ',') so that every selector is in its own line.

Fixes #1962
2017-06-08 07:46:24 -07:00
Christopher Chedeau f34492d7e5 Strip leading space for first combinators (#1807) 2017-05-29 12:49:25 -07:00
Christopher Chedeau dc287d32a5 Remove extra newline from empty @media (#1802) 2017-05-29 08:52:24 -07:00
Christopher Chedeau c4e32f4c78 Remove double spaces in @font-face (#1801) 2017-05-29 08:49:51 -07:00
Christopher Chedeau 375540efac Remove many spaces from media query (#1776)
The issue is really that the media query parser fails to parse the inner queries and just gives a raw string for the expression, but it should be safe to remove extra spaces. I can't make it rmeove spaces inside () that way unfortunately :(
2017-05-27 13:32:27 -07:00
Christopher Chedeau 48d35503c4 Remove space around media `and` (#1775) 2017-05-27 13:24:08 -07:00
Christopher Chedeau adb26e20ad Add space around ~ combinator (#1774) 2017-05-27 13:20:32 -07:00
Christopher Chedeau bb0c184855 Fix broken tests
If you put a space, `{loose: true}` is going to parse them as word + paren instead of func. It doesn't impact correctness and i'm not really sure how to clean the ast, so let's just make the test pass. I haven't seen this anywhere in real code.
2017-05-27 13:16:11 -07:00
Christopher Chedeau 3c110b0230 Indent groups (#1772)
This way it looks less weird when they break
2017-05-27 13:01:38 -07:00
Christopher Chedeau f3823276eb Enable loose mode for postcss-values-parser (#1766)
Fixes https://github.com/shellscape/postcss-values-parser/issues/29
2017-05-27 11:15:05 -07:00
Christopher Chedeau 78ba808322 Initial CSS support (#1636)
I wanted to see how hard it would be to add support for CSS inside of prettier. Turns out, it's not that hard. I spent a few hours printing post-css values and getting all the stylefmt unit tests to not throw.
2017-05-24 10:52:12 -07:00