Skip to content

Commit 796c5f3

Browse files
committed
add before/after in readme (closes #6)
1 parent 653307c commit 796c5f3

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

README.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ You can also use a config file with the combination of [generateMapping](#genera
1313

1414
- [Installation](#installation)
1515
- [Usage](#usage)
16+
- [Before/After](#beforeafter)
1617
- [RCS Config](#rcs-config)
1718
- [Methods](#methods)
1819
- [LICENSE](#license)
@@ -57,6 +58,80 @@ rcs.processCss('**/*.css', options, err => {
5758
})
5859
```
5960

61+
## Before/After
62+
63+
- [CSS](#css)
64+
- [HTML](#html)
65+
- [JS](#js)
66+
- [Others](#others)
67+
68+
### CSS
69+
70+
**Before**
71+
```css
72+
.selector {
73+
...
74+
}
75+
76+
.another-selector {
77+
...
78+
}
79+
```
80+
81+
**After**
82+
```css
83+
.e {
84+
...
85+
}
86+
87+
.t {
88+
...
89+
}
90+
```
91+
92+
### HTML
93+
94+
> The CSS from before is used
95+
96+
**Before**
97+
```html
98+
...
99+
<div class="selector column">...</div>
100+
<span class="another-selector"></span>
101+
...
102+
```
103+
104+
**After**
105+
```html
106+
...
107+
<div class="e column">...</div>
108+
<span class="t"></span>
109+
...
110+
```
111+
112+
### JS
113+
114+
**Before**
115+
```js
116+
...
117+
$('.selector').addClass('column')
118+
document.getElementsByClassName('another-selector')
119+
```
120+
121+
**After**
122+
123+
> `.column` is never triggered, because it never appeared in CSS
124+
125+
```js
126+
...
127+
$('.e').addClass('column')
128+
document.getElementsByClassName('t')
129+
```
130+
131+
### Others
132+
133+
Every file can be triggered...
134+
60135
## RCS config
61136

62137
> Just create a `.rcsrc` in your project root or you can add everything in your `package.json` with the value `rcs`

0 commit comments

Comments
 (0)