Chi (pronounced chee) provides developers with a collection of HTML and CSS patterns to build fast, reusable, and consistent responsive interfaces.
Adding Chi to your project is as simple as loading the Chi stylesheet from the CenturyLink Assets Server. Not only is this a great way to get started with Chi, it is also a highly available and performant option for loading the required assets into your project.
<link rel="stylesheet" href="https://assets.ctl.io/chi/1.1.1/chi.css">
Next, add the
chi CSS class to the
<html> tag of your document to properly scope the styles.
This allows Chi to override any existing styles that have been defined by legacy markup.
<html class="chi"> ... </html>
At this point you will be able to target the styles available in Chi by referencing documentation.
The preferred way to setup your development environment is with Docker. If you have Docker installed, run the command:
$ npm run docker -- start
Once the container has been bootstrapped and the Chi project has started, connect to http://localhost:8000 in your browser to load Chi. While running, any changes to the Chi source will be automatically reloaded in your browser.
You may also run the project without Docker by following the standard conventions for Node.js-based applications:
$ npm install $ npm start
We use BackstopJS for visual regression testing of our CSS components. In order to account for differences in development environments we always run these tests in a consistent Docker container. To execute the test suite, run the following command:
$ npm run docker -- test
A report containing the results of the test will be created under
reports/html_report. If there were failures,
you will need to visually examine the changes and act appropriately based on the anticipated results.
If you receive a test failure and you've made changes that you know are correct, you will need to override the test
references with your new changes by running the
approve command on BackstopJS:
$ npm run docker -- approve
Once you have approved the changes, commit the new reference files with your changes.