Git Product home page Git Product logo

debut-shopify-tailwind-starter's Introduction

Build Status Coverage Status Open Source Love svg1

debut-shopify-tailwinnd-starter



Debut theme starter project using tailwindcss.

This project is the most easy way to combine shopify theme (css/sass) using tailwindCSS without css override.

Alt text

Table of Contents


Setup

1 - Setup theme kit.

$ theme watch

Synchronize as a priority the local theme with the sass theme. More information here shopifyThemekit shopifyThemekitCommands

2 - Modify theme.liquid with this line.

  {{ 'file.css' | asset_url | stylesheet_tag }}

This file.css is the new tailwindcss class generated using nodejs script

# install dependencies
$ npm install
$ npm run dev
$ npm run prod

npm run dev generate generate a file.css with ALL tailwind class for production.

npm run prod script scan all the theme and search specify tailwind.class


Compatibility issues shopify + Tailwindcss

Initially tailwindcss posed a lot of style problems on a shopify project. I have desactivated two important core plugin see tailwin.config.js. See Tailwind CSS Core plugins

Preflight modify global style, like size/spacing of svg icon. H1/H2 etc... Display override grid class. It breaks the navigation bar, product page and some sections. A solution exist. You can manually replace grid class by flexbox class like on this example, but the result are not perfect.

grid grid--no-gutters grid--table

by

flex flex-row items-center

Here the actual tailwind config file

// tailwind.config.js
module.exports = {
  corePlugins: {
    preflight: false,
    display: false
  }
}

The other way around. Here's a list of all the plugins that work.

// tailwind.config.js
module.exports = {
  corePlugins: [
    'container',
    'accessibility',
    'alignContent',
    'alignItems',
    'alignSelf',
    'appearance',
    'backgroundAttachment',
    'backgroundColor',
    'backgroundPosition',
    'backgroundRepeat',
    'backgroundSize',
    'borderCollapse',
    'borderColor',
    'borderRadius',
    'borderStyle',
    'borderWidth',
    'boxSizing',
    'boxShadow',
    'clear',
    'cursor',

    'fill',
    'flex',
    'flexDirection',
    'flexGrow',
    'flexShrink',
    'flexWrap',
    'float',
    'gap',
    'gridAutoFlow',
    'gridColumn',
    'gridColumnStart',
    'gridColumnEnd',
    'gridRow',
    'gridRowStart',
    'gridRowEnd',
    'gridTemplateColumns',
    'gridTemplateRows',
    'fontFamily',
    'fontSize',
    'fontSmoothing',
    'fontStyle',
    'fontWeight',
    'height',
    'inset',
    'justifyContent',
    'letterSpacing',
    'lineHeight',
    'listStylePosition',
    'listStyleType',
    'margin',
    'maxHeight',
    'maxWidth',
    'minHeight',
    'minWidth',
    'objectFit',
    'objectPosition',
    'opacity',
    'order',
    'outline',
    'overflow',
    'padding',
    'pointerEvents',
    'position',
    'resize',
    'rotate',
    'scale',
    'skew',
    'stroke',
    'strokeWidth',
    'tableLayout',
    'textAlign',
    'textColor',
    'textDecoration',
    'textTransform',
    'transform',
    'transitionDuration',
    'transitionProperty',
    'transitionTimingFunction',
    'translate',
    'userSelect',
    'verticalAlign',
    'visibility',
    'width',
    'wordBreak',
    'zIndex',
  ]
}

Contributing

  1. Create a fork of this project
  2. Clone the project:
git clone https://github.com/<YOUR_GITHUB_USERNAME>/debut-shopify-tailwind-starter
  1. Create your Feature Branch (git checkout -b AmazingFeature)
  2. Commit your Changes (git commit -m 'Add some AmazingFeature')
  3. Push to the Branch (git push origin feature/AmazingFeature)
  4. Open a Pull Request

--

Useful link and ressources

debut-shopify-tailwind-starter's People

Contributors

albertlanne avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.