Skip to content

Commit

Permalink
Added new custom preprocessor example
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpicyMeatball committed Mar 16, 2021
1 parent 422dcd4 commit d0ff1a3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ export const someStyle = {

```
const changePaddingToMargin = file => file.replace('padding: ', 'margin: ');
const addTimeStamp = file => `${file}\n\n// Compiled: ${(new Date()).toString()}`;
// Setup preprocessor:
const preprocess = preprocessor(tokens, './my-tokens', [changePaddingToMargin]);
const preprocess = preprocessor(tokens, './my-tokens', [changePaddingToMargin, addTimeStamp]);
```

<h5>styles.js</h5>
Expand All @@ -134,6 +135,8 @@ export const something = {
fontSize: 12,
margin: 16,
};
// Compiled: Tue Mar 16 2021 06:15:06 GMT-0500 (Central Daylight Time)
```

<h4>Multiple Files</h4>
Expand Down
5 changes: 4 additions & 1 deletion dist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ export const someStyle = {

```
const changePaddingToMargin = file => file.replace('padding: ', 'margin: ');
const addTimeStamp = file => `${file}\n\n// Compiled: ${(new Date()).toString()}`;
// Setup preprocessor:
const preprocess = preprocessor(tokens, './my-tokens', [changePaddingToMargin]);
const preprocess = preprocessor(tokens, './my-tokens', [changePaddingToMargin, addTimeStamp]);
```

<h5>styles.js</h5>
Expand All @@ -134,6 +135,8 @@ export const something = {
fontSize: 12,
margin: 16,
};
// Compiled: Tue Mar 16 2021 06:15:06 GMT-0500 (Central Daylight Time)
```

<h4>Multiple Files</h4>
Expand Down
5 changes: 4 additions & 1 deletion src/preprocessor/EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ export const someStyle = {

```
const changePaddingToMargin = file => file.replace('padding: ', 'margin: ');
const addTimeStamp = file => `${file}\n\n// Compiled: ${(new Date()).toString()}`;
// Setup preprocessor:
const preprocess = preprocessor(tokens, './my-tokens', [changePaddingToMargin]);
const preprocess = preprocessor(tokens, './my-tokens', [changePaddingToMargin, addTimeStamp]);
```

<h5>styles.js</h5>
Expand All @@ -94,6 +95,8 @@ export const something = {
fontSize: 12,
margin: 16,
};
// Compiled: Tue Mar 16 2021 06:15:06 GMT-0500 (Central Daylight Time)
```

<h4>Multiple Files</h4>
Expand Down

0 comments on commit d0ff1a3

Please sign in to comment.