All Projects → bit3725 → postcss-shopify-settings-variables

bit3725 / postcss-shopify-settings-variables

Licence: MIT License
PostCSS plugin for variable of theme setting in shopify css file.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to postcss-shopify-settings-variables

Bootstrap4-RTL
🅱 An Awesome RTL bootstrap 4 with gulp and postcss
Stars: ✭ 89 (+535.71%)
Mutual labels:  postcss
webpack-typescript-react
Webpack 5 boilerplate with support of most common loaders and modules (see tags and description)
Stars: ✭ 185 (+1221.43%)
Mutual labels:  postcss
ying-template
这是一个基于 `webpack@^5.27.2` + `typescript@^4.2.3` + `@babel/core@^7.2.2` + `jest@^26.6.3` + `eslint@^7.22.0` 的多页面脚手架。
Stars: ✭ 125 (+792.86%)
Mutual labels:  postcss
postcss-typed-css-classes
PostCSS plugin that generates typed entities from CSS classes for chosen programming language.
Stars: ✭ 12 (-14.29%)
Mutual labels:  postcss
postcss-sort-media-queries
PostCSS plugin for combine and sort CSS media queries with mobile first or desktop first methods.
Stars: ✭ 118 (+742.86%)
Mutual labels:  postcss
tailwindcss-postcss-browsersync-boilerplate
Tailwind CSS + PostCSS + BrowserSync boilerplate
Stars: ✭ 28 (+100%)
Mutual labels:  postcss
fortune
🔮Fortune is your friendly CSS properties framework.
Stars: ✭ 16 (+14.29%)
Mutual labels:  postcss
caesura
📏 A reasonable breakpoint scale using @Custom-Media
Stars: ✭ 14 (+0%)
Mutual labels:  postcss
stencil-tailwind-plugin
Plugin for using tailwindcss with StencilJS
Stars: ✭ 17 (+21.43%)
Mutual labels:  postcss
meteor-postcss
PostCSS for Meteor
Stars: ✭ 68 (+385.71%)
Mutual labels:  postcss
aik
Frontend Playground
Stars: ✭ 43 (+207.14%)
Mutual labels:  postcss
dva-typescript-antd-starter-kit
A admin dashboard application demo based on antd by typescript and dva
Stars: ✭ 61 (+335.71%)
Mutual labels:  postcss
vite-ts-tailwind-starter
Opinionated Vite + Vue 3 + TypeScript + Tailwind CSS starter template w/ tests and CI.
Stars: ✭ 228 (+1528.57%)
Mutual labels:  postcss
postcss-define-function
PostCSS plugin for Sass-like function directive
Stars: ✭ 25 (+78.57%)
Mutual labels:  postcss
tailwind-bootstrap-grid
Tailwind CSS plugin that generates Bootstrap's flexbox grid
Stars: ✭ 96 (+585.71%)
Mutual labels:  postcss
postcss-clean
PostCss plugin to minify your CSS with clean-css
Stars: ✭ 41 (+192.86%)
Mutual labels:  postcss
react-cli
基于 create-react-app 搭建的前端脚手架
Stars: ✭ 18 (+28.57%)
Mutual labels:  postcss
hugo-starter-tailwind-basic
A basic and simple to set up Hugo with TailwindCSS starter project.
Stars: ✭ 80 (+471.43%)
Mutual labels:  postcss
building-realworld-user-interfaces-using-tailwind
Demo of building real-world UIs using TailwindCSS
Stars: ✭ 87 (+521.43%)
Mutual labels:  postcss
postcss-bidirection
PostCSS plugin that polyfill Bi-directional CSS properties and values to suppot rtl and ltr rules in all browsers
Stars: ✭ 24 (+71.43%)
Mutual labels:  postcss

PostCSS Shopify Settings Variables Build Status

PostCSS plugin to allow use of Shopify specific theme variables in Shopify css files.

It's common in a Shopify theme css file to use code such as {{ settings.headline_color }} as a value of css property. Sadly, this will cause some annoying issues such as your code editor will loose syntax highlighting, and more. This happens because such values are invalid form of css.

With this simple PostCSS plugin, you can safely use code like $(headline_color) instead. This code will be transformed to the syntax Shopify parsers support.

.foo {
    color: $(headline_color);
    font-family: $(regular_websafe_font | replace: '+', ' ');
    font-size: $(regular_font_size)px;
    border: 1px solid $(border_color);
    background: rgba($(settings.header_bg_color), 0.9);
    background: url(logo.png);
    background: url(logo.png | split: '?' | first);
}

Will be transformed to:

.foo {
    color: {{ settings.headline_color }}; /* Shopify friendly values */
    font-family: {{ settings.regular_websafe_font | replace: '+', ' ' }};
    font-size: {{ settings.regular_font_size }}px;
    border: 1px solid {{ settings.border_color }};
    background: rgba({{ settings.header_bg_color }}, 0.9);
    background: url({{ "logo.png" | asset_url }});
    background: url({{ "logo.png" | asset_url | split: '?' | first }});
}

Usage

postcss([ require('postcss-shopify-settings-variables') ])

See PostCSS docs for examples for your environment.

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].