33 Commits
Author SHA1 Message Date
Andrey Sitnik 8ed0f0871a Replace nanocolors with picocolors 2021-10-04 22:06:17 +02:00
Andrey Sitnik 8dcc7801e7 Replace chalk to nanocolors 2021-09-25 08:55:08 +02:00
Andrey Sitnik f71499fcd0 Use Error as a parent of CssSyntaxError 2018-12-16 20:49:03 -05:00
IvanandAndrey Sitnik 28586fb219 Refactoring, delete unnecessary else (#1186) 2018-09-12 17:00:46 +02:00
Andrey Sitnik d94ddb4536 Update code style 2018-07-30 14:09:27 -04:00
Andrey Sitnik 7f6c9d09fe Reduce bundle size by removing terminal-highlight 2018-07-16 08:36:10 -07:00
Andrey Sitnik e7e04e40c6 Update code style 2018-07-16 08:36:10 -07:00
Andrey Sitnik b4bdd1182d Update supports-color 2018-01-02 11:01:49 +10:00
Andrey Sitnik 601ae6e5f4 Reduce size bundle for browser 2017-08-24 23:19:16 +08:00
Andrey Sitnik dcf14737e8 Fix chalk in CssSyntaxError too 2017-06-28 14:13:18 -03:00
Andrey Sitnik 8bd5a2ec16 Fix spaces 2017-06-28 12:20:23 -03:00
Andrey Sitnik 32111bd496 Remove deprecated methods from 4.x 2017-05-01 12:17:55 +02:00
Garet McKinleyandAndrey Sitnik e1a1b4c1c9 Fix typo in generated() deprecation message (#960) 2017-02-06 02:18:47 +05:30
Simon LydellandAndrey Sitnik 1642ad49cf Improve syntax highlight (sync with babel-code-frame) (#897)
* Minor syntax highlight adjustments

- Highlight at-words in cyan instead of red.
- Highlight strings in green instead of red.
- Highlight punctuation in yellow instead of bold. (Uncolored bold does
  not look very good on Ubuntu based systems.)
- Don't highlight the token at the error location with a red background.

The idea is to reserve red for errors, and sync with babel-code-frame.

Note that `()` are _not_ highlighted. Those characters are usually part
of a 'brackets' token, which is already highlighted. When they're not,
highlighting them did not improve the output.

Many text editor color schemes (and babel-code-frame) don't highlight
`{}[]`, because those characters are usually surrounded by other colored
tokens, which makes the output to noisy. However, that's not true for
postcss' syntax highlighter, so it makes sense to highlight those
characters.

* Add syntax highlighting for classes and hashes

Hashes refer to `#id` selectors and `#f50` colors.

* Add syntax highlighting for "calls"

Calls refer to the word before a 'brackets' or '(' token, such as in
`not(...)`, `rgb(0, 0, 0)` and `calc(...)`.
2016-09-30 07:57:14 +03:00
Andrey Sitnik fcce3bd658 Better syntax highlight 2016-09-29 12:33:18 +03:00
Andrey Sitnik 05dac59008 Fix JSDoc example 2016-09-08 11:59:48 +10:00
Andrey Sitnik 6de6654a23 Fix lines count after error 2016-09-07 13:39:37 +10:00
Simon LydellandAndrey Sitnik 329b90c573 Various terminal highlighter fixes (#877)
* Fix multiline tokens highlighting the line gutter

* Fix typo in test description in test/css-syntax-error.js

* Fix ^ position when highlighting code indented with tabs
2016-09-04 21:09:15 +10:00
Andrey PoppandAndrey Sitnik 7f9754a4fe Add highlighter for terminal 2016-09-04 08:33:47 +10:00
Andrey Sitnik 9295957996 Do not use red color for syntax error mark 2016-09-04 07:53:11 +10:00
Andrey Sitnik f09aeea240 Update comments for new error string 2016-09-03 07:41:34 +10:00
Andrey Sitnik 67244c9db2 Add padding for numbers and show more lines 2016-09-03 07:41:34 +10:00
Andrey Sitnik d3c80e91e4 Use babel style code example in CSS syntax error 2016-09-03 07:41:34 +10:00
Andrey Sitnik 96726c677b Add examples to every property JSDoc 2016-06-18 20:39:27 +03:00
Andrey Sitnik 1729913e71 Add JSDocs to CssSyntaxError 2016-06-18 19:59:04 +03:00
Andrey Sitnik df34332225 Use only ES2015 2016-05-22 13:06:02 +03:00
Andrey Sitnik 9cc9e808f6 Clean up code from instanbul comments 2016-05-14 15:10:23 +02:00
Andrey Sitnik 74ea13356f Remove outdated Mozilla error props 2015-12-15 18:58:31 +03:00
Andrey Sitnik 610bb044be Ignore depreacted methods from coverage tool 2015-12-15 18:54:13 +03:00
Andrey Sitnik b2d22246e9 Use Babel 6 2015-12-15 18:20:16 +03:00
Andrey Sitnik a562156278 Add deprecated warning for CssSyntaxError#generated 2015-08-17 16:20:42 +03:00
Andrey Sitnik a0c0804cef Remove depreacted methods from 5.0 2015-08-17 16:20:42 +03:00
Andrey Sitnik f43a45a907 Use .es6 ext for ES6 sources 2015-08-17 16:20:40 +03:00