

Postcss XML transform
source link: https://www.tuicool.com/articles/hit/FvyIZjz
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

postcss-xml-transform
A tiny transform library that lets you write CSS using XML
Usage
const postcss = require('postcss'); const xss = require('./parser'); postcss() .process(css, { parser: xss }) .then(function(result) { console.log(result.content); });
Use xss
as a parser.
Why?
If i'm being completely honest this sort of begun as a jokey idea and then evolved into an exploration of of postcss
works on the inside and how to write transforms for it and such
What can I use this library for?
Imagine this, you hold a senior position at a company you hate. You write up a compelling case for css in xml, something about the Android developers having an easier time with this because android uses xml. Probably. Nobody in your company really cares enough about the Android app to even know do they. You lead a team for two months to rewrite the entire CSS stack in this abhorrent XML thing. It should actually work with css modules and stuff. Hell you could even write a jsx pragma. You leave. Retire to the Bahamas for a bunch of months. The company you hated all along now has to maintain this . You sip a strawberry mojito in the beach and pet a bird. Things are good. You made it.
Is there like a spec or anything?
Hahahsahjbddsvufbf of course not I already had enough trouble rationalizing how separate the parsers for the declaration xml and the root xml should be to bother writing anything up.
Please refer to the test page or to the three files of code that i refactored so thoroughly that everything is now an abstract mess nobody can follow. I don't even know how this works. it's amazing. i love it.
Can I use the stringify method?
No.
Can I donate to help support development of this project?
I will donate to your project if you use this.
Are you aware XSS already stands for Cross Site Scripting?
Yes but THAT should actually be called css
. It's not my fault whatever commitee came up with that name wanted to sound 'radical' or 'extreme' because their legal guardians didn't get them those sneakers with built in rollerblades. Once this project gains traction I will submit a formal proposal to rename cross site scripting to css as it always should have been called.
But what about the existing CSS then?
I asked alexa for cascade synonyms and she says we should use waterfalling style sheets. WSS. There, fixed.
Recommend
-
128
现在的前端,javascript的发展有目共睹,框架林立。同时,html也是齐头并进,推出了HTML5标准,并且得到了普及。这样的发展却唯独少了一个角色? CSS,就是这个看似不起眼的家伙,却在开发中发挥着和js一样重要的作用。css,是一...
-
53
-
63
README.md WebP in CSS
-
29
css-properly PostCSS plugin for people who prefer to write English properly. .foo { colour: black; background-colour: lightgrey; text-align: ce...
-
18
背景 随着 8.0 版本的发布,PostCSS 也迎来了一次大版本的更新,该版本的代号被命名为“欧赛魔神”(President Ose)。经过这次更新之后,PostCSS 插件的作者可以有选择性地使用一新 API,该 API 能够提升构建速度以及减少插件用...
-
14
Generating CSS from scratch with PostCSS
-
13
Plugin migration guide — Martian Chronicles, Evil Martians’ team blogPostCSS received a major update with the release of version 8.0 codenamed “President Ose”. Plugin creators can now opt in for a new API that сan increase build speeds and re...
-
5
Here's what it brings — Martian Chronicles, Evil Martians’ team blogPostCSS 8.0 now has its dedicated branch in the project repo. In keeping up with the tradition, the name of the new...
-
5
[Python] Use XSL to Transform XML (XSLT) Updated: February 18, 2015 To transform
-
7
Transformácie XML súborov v Jave pomocou TraX /home/robonovotny Transformácie XML súborov v Jave pomocou TraX 2007/09/30
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK