source: frontend/node_modules/stylehacks/README.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.6 KB
Line 
1# stylehacks
2
3> Detect/remove browser hacks from CSS files.
4
5
6## Install
7
8With [npm](https://npmjs.org/package/stylehacks) do:
9
10```
11npm install stylehacks --save
12```
13
14
15## Example
16
17In its default mode, stylehacks will remove hacks from your CSS file, based on
18the browsers that you wish to support.
19
20### Input
21
22```css
23h1 {
24 _color: white;
25 color: rgba(255, 255, 255, 0.5);
26}
27```
28
29### Output
30
31```css
32h1 {
33 color: rgba(255, 255, 255, 0.5);
34}
35```
36
37
38## API
39
40### `stylehacks.detect(node)`
41
42Type: `function`
43Returns: `boolean`
44
45This method will take any PostCSS *node*, run applicable plugins depending on
46its type, then will return a boolean depending on whether it found any of
47the supported hacks. For example, if the `decl` node found below is passed to
48the `detect` function, it will return `true`. But if the `rule` node is passed,
49it will return `false` instead.
50
51```css
52h1 { _color: red }
53```
54
55### `postcss([ stylehacks(opts) ])`
56
57stylehacks can also be consumed as a PostCSS plugin. See the
58[documentation](https://github.com/postcss/postcss#usage) for examples for
59your environment.
60
61#### options
62
63##### lint
64
65Type: `boolean`
66Default: `false`
67
68If lint mode is enabled, stylehacks will not remove hacks from the CSS; instead,
69it will add warnings to `Result#messages`.
70
71
72## Related
73
74stylehacks works well with your existing PostCSS setup:
75
76* [stylelint] - Comprehensive & modern CSS linter, to ensure that your code
77 style rules are respected.
78
79
80## Contributing
81
82Pull requests are welcome. If you add functionality, then please add unit tests
83to cover it.
84
85
86## License
87
88MIT © [Ben Briggs](http://beneb.info)
89
90
91[stylelint]: https://github.com/stylelint/stylelint
Note: See TracBrowser for help on using the repository browser.