mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-21 00:09:51 +02:00

Test that `src/diagrams/*/styles.ts` module returns a valid CSS stylesheet that can be parsed via [stylis][1] and then becomes a valid CSS that [csstree-validator][2] validates. We test this for every diagram and for every theme, because many of the invalid CSS bugs are caused by missing theme vars. There are some CSS errors that I couldn't easily fix, so I've written the tests to ignore the following CSS errors: - 'Unknown property `rx`' (Valid in SVG2 draft and in some browsers) - 'Unknown property `ry`' (Valid in SVG2 draft and in some browsers) - 'Unknown property `dy`' - This doesn't seem to be valid CSS in any SVG version, but maybe some browsers support it 🤷 I feel like we should probably change this though. [1]: https://github.com/thysultan/stylis [2]: https://github.com/csstree/validator