Skip to content

CSS API

Jack Haystead edited this page Mar 6, 2022 · 1 revision

For a site that doesn't have it's own repository, the CSS API can be used via core-template to store custom styles.

GET an existing CSS file

To GET an existing CSS file for a site, follow these steps:

  1. Pull the latest version of core-template.
  2. Change the siteUrl in kibble.json to your site's URL.
  3. Run npm run css:local:get. This script will obtain the latest stored CSS file for your site and place it in site/static/styles/local.css.
  4. In site/templates/application/application.jet, uncomment the local.css filename assignment line to be able to run the site with your local css file.

PUT a new/modified CSS file

To PUT a new or modified CSS file for a site, follow these steps:

  1. Pull the latest version of core-template.
  2. Change the siteUrl in kibble.json to your site's URL.
  3. Add a file called local.css to the site/static/styles directory and write some CSS inside it. Alternatively, run the GET script to obtain the latest stored CSS file and modify some CSS inside it.
  4. Run the site locally to test your CSS.
  5. Run npm run css:local:put to upload your local.css file to the API. You will be asked to enter an admin email address and password.

Clone this wiki locally