demo-gulp-postcss-autoprefixer

Demo of Gulp, PostCSS, Autoprefixer for automating CSS workflows

https://github.com/joelparkerhenderson/demo-gulp-postcss-autoprefixer

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.0%) to scientific vocabulary
Last synced: 8 months ago · JSON representation ·

Repository

Demo of Gulp, PostCSS, Autoprefixer for automating CSS workflows

Basic Info
  • Host: GitHub
  • Owner: joelparkerhenderson
  • Default Branch: master
  • Size: 1000 Bytes
Statistics
  • Stars: 4
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created almost 6 years ago · Last pushed about 1 year ago
Metadata Files
Readme Citation

README.md

Demo Gulp PostCSS Autoprefixer

Demo of:

  • Gulp tool to automate & enhance your workflow

  • PostCSS tool for transforming CSS with JavaScript

  • Autoprefixer plugin to parse CSS and add vendor prefixes to CSS rules

Setup

Create a Node project

Create the directory:

sh mkdir demo cd demo

Initiatlize git and add typical git ignore rules for any Node softare:

sh git init curl https://github.com/github/gitignore/blob/master/Node.gitignore -o .gitignore

Initialize Node Package Manager (NPM), which handles package installation, version management, and dependency management:

sh npm init -y

Add Gulp build system

Install Gulp, which is a build system that automates tasks for website development:

sh npm install --global gulp-cli npm install --save-dev gulp

Verify:

sh gulp --version

sh CLI version: 2.3.0 Local version: 4.0.2

If gulp says "command not found", then try this help

Create gulpfile

Create a text file gulpfile.js:

```js var gulp = require('gulp');

gulp.task('default', async function() { console.log("gulp is running"); }); ```

Run:

sh gulp

sh … Using gulpfile …/gulpfile.js … Starting 'default'... gulp default is working … Finished 'default' after 2.63 ms

Add gulp-postcss

Install:

sh npm install gulp-postcss --save-dev

Edit gulpfile.js:

```js var gulp = require('gulp'); var postcss = require('gulp-postcss');

gulp.task('postcss', async function() { var plugin = [ // PostCSS plugins will go here ]; return gulp.src('./*.css') .pipe(postcss(plugin)) .pipe(gulp.dest('./dest')); }); ```

Create a CSS file such as styles.css:

css h1 { font-color: red; }

Run:

sh gulp postcss

sh Using gulpfile …/gulpfile.js … Starting 'postcss'... … Finished 'postcss' after 19 ms You did not set any plugins, parser, or stringifier. Right now, PostCSS does nothing. …

Verify results:

sh ls dest

sh output.css styles.css

Add any PostCSS plugin

Install any PostCSS plugin, such as autoprefixer:

sh npm install autoprefixer --save-dev

Edit gulpfile.js:

```js var gulp = require('gulp'); var postcss = require('gulp-postcss'); var autoprefixer = require('autoprefixer');

gulp.task('postcss', async function() { var plugin = [ autoprefixer() ]; return gulp.src('./*.css') .pipe(postcss(plugin)) .pipe(gulp.dest('./dest')); }); ```

Edit styles.css and try a setting that will use autoprefix:

css :fullscreen a { display: flex; }

Run:

sh gulp postcss

Verify results:

sh cat dest/styles.css

css :-webkit-full-screen a { display: flex; } :-ms-fullscreen a { display: flex; } :fullscreen a { display: flex; }

Owner

  • Name: Joel Parker Henderson
  • Login: joelparkerhenderson
  • Kind: user
  • Location: California

Software developer. Technology consultant. Creator of GitAlias.com, NumCommand.com, SixArm.com, and many open source projects.

Citation (CITATION.cff)

cff-version: 1.2.0
title: Demo Gulp PostCSS Autoprefixer
message: >-
  If you use this work and you want to cite it,
  then you can use the metadata from this file.
type: software
authors:
  - given-names: Joel Parker
    family-names: Henderson
    email: joel@joelparkerhenderson.com
    affiliation: joelparkerhenderson.com
    orcid: 'https://orcid.org/0009-0000-4681-282X'
identifiers:
  - type: url
    value: 'https://github.com/joelparkerhenderson/demo-gulp-postcss-autoprefixer/'
    description: Demo Gulp PostCSS Autoprefixer
repository-code: 'https://github.com/joelparkerhenderson/demo-gulp-postcss-autoprefixer/'
abstract: >-
  Demo Gulp PostCSS Autoprefixer
license: See license file

GitHub Events

Total
  • Push event: 1
Last Year
  • Push event: 1

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 2
  • Total Committers: 1
  • Avg Commits per committer: 2.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Joel Parker Henderson j****l@j****m 2
Committer Domains (Top 20 + Academic)