Babel plugin for writing curse words instead of important because reasons
WTFPL License
Babel plugin for writing curse words instead of important because reasons
The example is in styled-components but it also works with Glamor as seen here and Emotion as seen here because it just looks for strings.
In
import React from 'react';
import styled from 'styled-components';
const Title = styled.h1`
font-size: 1.5em;
text-align: center;
color: palevioletred;
`;
const Wrapper = styled.section`
padding: 4em;
background: papayawhip !fuck;
`;
render(
<Wrapper>
<Title>Hello World, this is my styled component!</Title>
</Wrapper>
);
Out
import React from 'react';
import styled from 'styled-components';
const Title = styled.h1`
font-size: 1.5em;
text-align: center;
color: palevioletred;
`;
const Wrapper = styled.section`
padding: 4em;
background: papayawhip !important;
`;
render(
<Wrapper>
<Title>Hello World, this is my styled component!</Title>
</Wrapper>
);
$ npm install babel-plugin-caralho --save-dev
or
$ yarn add babel-plugin-caralho --dev
.babelrc
(Recommended).babelrc
{
"plugins": ["caralho"]
}
$ babel --plugins caralho script.js
require("babel-core").transform("code", {
plugins: ["caralho"]
});
Instead of !fuck
, you can also choose from many more options in different languages and all of them will become !important
after Babel does his/her thing.
Awesome ! You can create a PR here: https://github.com/SaraVieira/curse-words and these tests and the ones in https://github.com/SaraVieira/postcss-caralho will be generated automatically 🎉
WTFPL – Do What the Fuck You Want to Public License.