Skip to content

Commit 70c18ee

Browse files
committed
docs: add some basic documentation
1 parent 682b6f7 commit 70c18ee

File tree

1 file changed

+47
-1
lines changed

1 file changed

+47
-1
lines changed

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,47 @@
1-
Example project for React Flag Icon Css
1+
Example project demonstrating the use of [React Flag Icon Css](//github.com/matteocng/react-flag-icon-css) with [React Css Modules](//github.com/gajus/react-css-modules), standard Css and custom flags. Powered by [Webpack 2](//github.com/webpack/webpack).
2+
3+
## Installation
4+
5+
It is recommended to use [Yarn](https://yarnpkg.com/) instead of npm for managing packages.
6+
7+
Clone the repository:
8+
9+
```bash
10+
$ git clone https://github.com/matteocng/react-flag-icon-css-example-multi.git && cd react-flag-icon-css-example-multi
11+
12+
```
13+
14+
Install the required modules:
15+
16+
```bash
17+
$ yarn
18+
```
19+
20+
Run the [Webpack development server](//github.com/webpack/webpack-dev-server) and apply the configuration for [React Css Modules](//github.com/gajus/react-css-modules):
21+
22+
```bash
23+
$ yarn start
24+
```
25+
26+
... or use standard Css:
27+
28+
29+
```bash
30+
$ yarn start:classes
31+
```
32+
33+
Open a browser and go here: [http://localhost:8080](http://localhost:8080).
34+
35+
## Notes
36+
37+
This example project uses the <code>USE_CSS_MODULES</code> environment variable (set by the <code>package.json</code> scripts) to allow for an easy "switch" between a configuration with or without [React Css Modules](//github.com/gajus/react-css-modules). This results in more complex code than need be.
38+
39+
In a real project you would probably choose to either go with [React Css Modules](//github.com/gajus/react-css-modules) or standard Css, removing the <code>USE_CSS_MODULES</code> switch and <code>getStylePropName</code>, replacing <code>[options.stylePropName]</code> in the React components with either <code>className</code> (standard Css) or <code>styleName</code> (modules).
40+
41+
## Contributing
42+
43+
Contributions are welcome. Please use a topic branch, follow the [AngularJS commit style guidelines](//github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines) and check that <code>yarn run pre-commit</code> returns zero errors before opening a PR. Thanks!
44+
45+
## License
46+
47+
This project is licensed under the terms of the [MIT license](LICENSE).

0 commit comments

Comments
 (0)