Skip to content

Commit 13d686a

Browse files
author
Vladimir Kalmykov
authored
Update readme.md
1 parent 4904342 commit 13d686a

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

readme.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $ npm install postcss-import-sub
1111

1212
## Usage
1313

14-
First, you should to read about [post-import](https://github.com/postcss/postcss-import), because the plugin uses its functionality and acts in the same way, with one exception: in the options you can define the specific rules the path substitution.
14+
First, you should read about [post-import](https://github.com/postcss/postcss-import), because the plugin uses its functionality and acts in the same way, with one exception: in the options you can define the specific rules the path substitution.
1515
```js
1616
// dependencies
1717
var fs = require("fs")
@@ -68,7 +68,7 @@ subImport([
6868
```
6969
This import will always search for red.css instead any required filename. Impractical example :)
7070

71-
But how about to replace only _blue.css_ into the _red.css_ and only if the request comes from a directory `pencil`?
71+
But how about to replace only the _blue.css_ into the _red.css_ and only if the request comes from a directory `pencil`?
7272

7373
_app/components/pencil/style.css_
7474
```css
@@ -90,11 +90,11 @@ subImport([
9090
])
9191
```
9292

93-
Hmm, how to use it in practice? To answer this question let's learn some more capability of plugin.
93+
Hmm, how to use it in practice? To answer this question let's learn some more capability of the plugin.
9494

9595
## Customization of styles
9696

97-
A nice feature of the plugin is the fact that if the overridden path is not exists, it will use the standard method of file resolving. It allows you to create an environment in which any style can work fine without substitution (for example, in the case of using classic postcss-import plugin). When you replace postcss-import to postcss-import-sub, you have the opportunity to customize the styles without spoiling the original sources.
97+
A nice feature of the plugin is the fact that if the overridden path does not exists, it will use the standard method of file resolving. It allows you to create an environment in which any style can work fine without substitution (for example, in the case of using the classic postcss-import plugin). When you replace postcss-import to postcss-import-sub, you have the opportunity to customize the styles without spoiling the original sources.
9898

9999
Imagine a set of components with styles which we'd like to have able to replace without editing component's files themselves.
100100

@@ -144,18 +144,18 @@ subImport([
144144
}
145145
]);
146146
```
147-
Last thing - we should to create the new file with new variables.
147+
The last thing, we should create the new file with new variables.
148148

149149
_theme/components/Pencil/variables.css_
150150
```css
151151
$PencilColor: blue;
152152
```
153153

154-
If you will build the application with same configuration, you'll see that Pencil became blue.
154+
If you will build the application with the same configuration, you'll see that Pencil became blue.
155155

156156
### Total coverage
157157

158-
In the last example we have indicated a specific file name, with which the substitution of imports must occur. And we have formed target filename. But in fact, we are not obliged to do so.
158+
In the last example, we have indicated a specific file name, with which the substitution of imports must occur. And we have formed target filename. But in fact, we are not obliged to do so.
159159

160160
Let's remove the excess.
161161

@@ -170,15 +170,15 @@ subImport([
170170
]);
171171
```
172172

173-
This example will _sub_ each imported css file in components directory.
173+
This example will _sub_ each imported CSS file in components directory.
174174

175175
The difference between option `path` and `to` is that __to__ - clearly specifies the file location, while __path__ - indicates only the directory to resolve. The requested file will be found in this directory automatically.
176176

177177
## Challenges
178178

179-
For the formation of complex paths, you should use regex. Regular expressions allow you to find specific words and then use them in the formation of paths.
179+
For the formation of complex paths, you should use regex. Regular expressions allow you to find specific words and then use them in the formation of paths.
180180

181-
Each result of the regular expression is placed in a special hashmap of aliases. Those aliases you can insert to the template string. Look at example to understand how it works.
181+
Each result of the regular expression is placed in a special hashmap of aliases. Those aliases you can insert to the template string. Look at next example to understand how it works.
182182

183183
```js
184184
subImport([
@@ -219,7 +219,7 @@ Usage of approach of the regular expression is limited only by your imagination.
219219

220220
## Using original postcss-import options
221221

222-
You can define original postcss-import options as well as the usual. But in this case the rules for a postcss-import-sub is specified in the property `sub`.
222+
You can define original postcss-import options as well as the usual. But in this case, the rules for a postcss-import-sub is specified in the property `sub`.
223223

224224
```js
225225
subImport({

0 commit comments

Comments
 (0)