All Projects → Shopify → Shopify Css Import

Shopify / Shopify Css Import

Licence: mit
Add CSS import functionality to Shopify theme development with Grunt.js or Gulp.js

Labels

Projects that are alternatives of or similar to Shopify Css Import

Popup Ajax Subscribe Form
A newsletter subscription form for Shopify with cookie support and ajax submit, with support for both internal Shopify newsletter subscriptions or MailChimp based subscriptions
Stars: ✭ 8 (-90.24%)
Mutual labels:  liquid
Liquid.net
.Net Port of the Liquid template language
Stars: ✭ 47 (-42.68%)
Mutual labels:  liquid
Solid
Liquid template engine in Elixir
Stars: ✭ 68 (-17.07%)
Mutual labels:  liquid
Timber
The ultimate Shopify theme framework, built by Shopify.
Stars: ✭ 911 (+1010.98%)
Mutual labels:  liquid
Jekyll Timeline
Timeline / Résumé Theme with Jekyll
Stars: ✭ 46 (-43.9%)
Mutual labels:  liquid
Jekyll Assets
🎨 Asset pipelines for Jekyll.
Stars: ✭ 1,083 (+1220.73%)
Mutual labels:  liquid
Shopify Lang
Multi-Language Shopify Online Shop
Stars: ✭ 26 (-68.29%)
Mutual labels:  liquid
Rustycrate.ru
Русскоязычный сайт о языке программирования Rust
Stars: ✭ 72 (-12.2%)
Mutual labels:  liquid
Slater Theme
Shopify Starter theme based on slate
Stars: ✭ 47 (-42.68%)
Mutual labels:  liquid
Openshift Migration Best Practices
Best practices for migrating from OpenShift 3 to 4
Stars: ✭ 64 (-21.95%)
Mutual labels:  liquid
Jekyll Liquify
A Jekyll filter that parses Liquid from front matter
Stars: ✭ 21 (-74.39%)
Mutual labels:  liquid
Jsx Lite
Write components once, run everywhere. Compiles to Vue, React, Solid, Angular, Svelte, and Liquid.
Stars: ✭ 1,015 (+1137.8%)
Mutual labels:  liquid
Shopify Naked
Completely naked Shopify theme to use as a starting point for theme development
Stars: ✭ 57 (-30.49%)
Mutual labels:  liquid
Liquid
Clojure Text Editor, for editing clojure code and markdown. Written entirely in Clojure with inspiration from Emacs and Vim.
Stars: ✭ 859 (+947.56%)
Mutual labels:  liquid
Ajaxify Cart
Ajaxify Your Shopify Cart
Stars: ✭ 71 (-13.41%)
Mutual labels:  liquid
Condensation
A collection of handy extensions to the Liquid templating engine
Stars: ✭ 7 (-91.46%)
Mutual labels:  liquid
Plankton
Open source simulator for maritime robotics researchers
Stars: ✭ 51 (-37.8%)
Mutual labels:  liquid
Glim
Static site generator which is semi-compatible with Jekyll
Stars: ✭ 76 (-7.32%)
Mutual labels:  liquid
Shopify Webpack Dev Workflow
Stars: ✭ 71 (-13.41%)
Mutual labels:  liquid
Gojekyll
A fast clone of the Jekyll blogging engine, in Go
Stars: ✭ 62 (-24.39%)
Mutual labels:  liquid

Deprecation warning ⚠️

Instead of these one-off grunt/gulp build tasks, developers are encouraged to check out Slate - a theme scaffolding and command line tool built for developing Shopify themes.

You can continue to use these tasks; however, this repo will not be kept up-to-date with changes in Shopify theme development.


Adding CSS @import to theme development

This guide will allow you to define your own folder structure for your stylesheets while building Shopify themes.

Stylesheets can be created and maintained in css/ from your theme's root folder.

In the example css/ folder there is a single theme.scss.liquid file that imports other stylesheets into it. Files starting with an underscore are not added to your assets/ folder.

You can use Grunt or Gulp to achieve the same effect.

The theme files included in this repo are just for the example. Find the latest version of Timber here.

Requirements

Basic theme structure

├── assets/
├── layout/
├── snippets/
├── templates/
│
├── // Non-theme files/folders (Theme Gem, Grunt, Gulp, etc.)
├── config.yml
├── css/
├── Gemfile
├── Gruntfile.js
├── package.json
├── gulpfile.js
└── node_modules/

Grunt.js

Navigate to your theme root in Terminal.

1. Install grunt globally
npm install -g grunt-cli

You may have to use sudo for this.

2. Move Gemfile, Gruntfile.js and package.json to your theme's root
3. Install gulp (globally) and gulp-cssimport

We specifically want the Gulp plugin so we have to install Gulp. Everything after this will be handled with Grunt.

npm install -g gulp
npm install gulp-cssimport

You may have to use sudo for this.

4. Install required packages
npm install
5. Run bundle install
bundle install
6. Run grunt
grunt

That's it. Gruntfile.js will run both theme watch to upload new theme files to your store and grunt gulp to concatenate the stylesheets in /css at the same time.

Gulp.js

Navigate to your theme root in Terminal.

1. Install gulp globally
npm install -g gulp

You may have to use sudo for this.

2. Move gulpfile.js file in your theme's root
3. Install required packages
npm install gulp-cssimport
4. Run gulp watch
gulp watch
5. Run Shopify theme gem

Make sure config.yml file is setup properly. Docs here. In a separate Terminal window that is still in your theme's root, run:

theme watch

Output

Once gulp or grunt runs it will create theme.scss.liquid inside your /assets/ folder. To call this file you need to place {{ 'theme.scss.css' | asset_url | stylesheet_tag }} inside your theme.liquid file. Shopify automatically compiles everything on their servers. If for some reason it is not compiling it's probable because there is a random charset somewhere inside your stylesheet.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].