All Projects → ionic-team → Stencil Postcss

ionic-team / Stencil Postcss

Licence: other
Autoprefixer plugin for Stencil

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Stencil Postcss

stencil-boilerplate
A Stencil app boilerplate including routing, Redux etc.
Stars: ✭ 51 (+168.42%)
Mutual labels:  postcss, stencil
Postcss Start To End
PostCSS plugin that lets you control your layout (LTR or RTL) through logical rather than physical rules
Stars: ✭ 18 (-5.26%)
Mutual labels:  postcss, postcss-plugins
postcss-if-media
A PostCSS plugin to inline or nest media queries within CSS rules & properties.
Stars: ✭ 35 (+84.21%)
Mutual labels:  postcss, postcss-plugins
Deventy
A minimal 11ty starting point for building static websites with modern tools.
Stars: ✭ 157 (+726.32%)
Mutual labels:  autoprefixer, postcss
react-cli
基于 create-react-app 搭建的前端脚手架
Stars: ✭ 18 (-5.26%)
Mutual labels:  postcss, postcss-plugins
Vanilla Back To Top
Simple and smooth Back To Top button
Stars: ✭ 179 (+842.11%)
Mutual labels:  autoprefixer, postcss
laggard
Automatically generate CSS fallbacks for legacy browsers, built on PostCSS
Stars: ✭ 23 (+21.05%)
Mutual labels:  postcss, postcss-plugins
Bathe
The simplest WordPress starter theme including full setup for Sass, PostCSS, Autoprefixer, stylelint, Webpack, Eslint, imagemin, Browsersync, etc.
Stars: ✭ 65 (+242.11%)
Mutual labels:  autoprefixer, postcss
Gulp Autoprefixer
Prefix CSS
Stars: ✭ 676 (+3457.89%)
Mutual labels:  autoprefixer, postcss
stencil-tailwind-plugin
Plugin for using tailwindcss with StencilJS
Stars: ✭ 17 (-10.53%)
Mutual labels:  postcss, stencil
Fast
Develop, build, deploy, redeploy, and teardown frontend projects fast.
Stars: ✭ 126 (+563.16%)
Mutual labels:  autoprefixer, postcss
Turretcss
Turret is a styles and browser behaviour normalisation framework for rapid development of responsive and accessible websites.
Stars: ✭ 729 (+3736.84%)
Mutual labels:  autoprefixer, postcss
Frasco
Quick starter for Jekyll including full setup for Sass, PostCSS, Autoprefixer, stylelint, Webpack, ESLint, imagemin, Browsersync, etc.
Stars: ✭ 123 (+547.37%)
Mutual labels:  autoprefixer, postcss
Next Starter Tailwind
Next.js starter styled with Tailwind CSS
Stars: ✭ 225 (+1084.21%)
Mutual labels:  autoprefixer, postcss
Fabium
+100 for productivity
Stars: ✭ 108 (+468.42%)
Mutual labels:  autoprefixer, postcss
nextsss
Next.js static site starter including full setup for TypeScript, Tailwind CSS, Google Analytics, Next SEO, etc.
Stars: ✭ 80 (+321.05%)
Mutual labels:  postcss, autoprefixer
Stylefmt
stylefmt is a tool that automatically formats stylesheets.
Stars: ✭ 2,123 (+11073.68%)
Mutual labels:  postcss, postcss-plugins
Webpack Es6 Sass Setup
A basic setup for Webpack with ES6, Babel, Sass and stylelint
Stars: ✭ 63 (+231.58%)
Mutual labels:  autoprefixer, postcss
postcss-gtk
Processes GTK+ CSS into browser CSS
Stars: ✭ 23 (+21.05%)
Mutual labels:  postcss, postcss-plugins
Postcss Utilities
PostCSS plugin to add a collection of mixins, shortcuts, helpers and tools for your CSS
Stars: ✭ 293 (+1442.11%)
Mutual labels:  postcss, postcss-plugins

@stencil/postcss

This package is used in order to integrate with postcss and all of its plugins.

First, npm install within the project:

npm install @stencil/postcss --save-dev

Next, within the project's stencil.config.ts file, import the plugin and add it to the plugins config. In the example below we're using the autoprefixer postcss plugin, so you'll also have to run:

npm install autoprefixer @types/autoprefixer --save-dev

This plugin requires Node.js 14 or higher. For older Node versions, see the 1.x release.

stencil.config.ts

import { Config } from '@stencil/core';
import { postcss } from '@stencil/postcss';
import autoprefixer from 'autoprefixer';

export const config: Config = {
  plugins: [
    postcss({
      plugins: [autoprefixer()]
    })
  ]
};

During development, this plugin will use postcss to process any plugins you may have passed along.

Options

Postcss has an ecosystem of plugins itself (a plugin for a plugin if you will). For our example, we're using the autoprefixer plugin, and configuring its options. Note, you can pass any valid autoprefixer option.

exports.config = {
  plugins: [
    postcss({
      plugins: [
        autoprefixer({
          browsers: ['last 6 versions'],
          cascade: false
        })
      ]
    })
  ]
};

Inject Globals Paths

The injectGlobalPaths config is an array of paths that automatically get added as @import declarations to all components. This can be useful to inject variables, mixins and functions to override defaults of external collections. Relative paths within injectGlobalPaths should be relative to the stencil.config.js file.

exports.config = {
  plugins: [
    postcss({
      injectGlobalPaths: [
        'src/globals/variables.pcss',
        'src/globals/mixins.pcss'
      ]
    })
  ]
};

Note that each of these files are always added to each component, so in most cases they shouldn't contain CSS because it'll get duplicated in each component. Instead, injectGlobalPaths should only be used for Sass variables, mixins and functions, but not contain any CSS.

Valid file extensions

This plugin will only transpile files whose extensions are .css, .pcss, or .postcss.

Related

Contributing

Please see our Contributor Code of Conduct for information on our rules of conduct.

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