Setting up the Pattern Library for development
Setting up the pattern library for development
The pattern library holds all styles for the platform-client and its here changes to the css is made.
Note: If you are not planning to change the css for the Platform-client, you do not need to follow this guide.
Clone the pattern library
Install the dependencies.
Run gulp build
to generate the fonts and compile the sass the first time.
Start the pattern library in http://localhost:8000 by running:
Once the pattern-library is running, the front-end guidelines and a guide on how to work with the pattern-library and its structure can be found on http://localhost:8000/assets/html/front-end-guidelines/introduction.html
But how do I test my new styles in the Platform?
The pattern-library is installed as a npm-package in the Platform Client. For development, it is not suitable to publish a package for each change, and luckily, there is hack you can do to test the styles locally instead.
Make sure the Pattern-library is built through running
gulp build
in the terminalCopy all contents in the "assets" folder
Go to your Platform-client folder
Navigate to node_modules/ushahidi-platform-pattern-library folder
Remove the contents in the "assets" folder
Paste the contents you copied from the assets-folder in the pattern-library
Done! Now you should be able to see the changes in the Platform Client
Further reading
After setup, please read the Platform Pattern Library guidelines when working with the Platform Pattern Library.