mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Merge commit '41bc6f702aa54200530efbf4267e5c823df3028d'
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: PostCSS
|
||||
description: Hugo Pipes can process CSS files with PostCSS.
|
||||
date: 2018-07-14
|
||||
publishdate: 2018-07-14
|
||||
categories: [asset management]
|
||||
keywords: []
|
||||
menu:
|
||||
@@ -10,7 +8,6 @@ menu:
|
||||
parent: "pipes"
|
||||
weight: 40
|
||||
weight: 40
|
||||
sections_weight: 40
|
||||
---
|
||||
|
||||
Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below.
|
||||
@@ -22,11 +19,11 @@ The resource will be processed using the project's or theme's own `postcss.confi
|
||||
{{ $style := $css | resources.PostCSS }}
|
||||
```
|
||||
|
||||
{{% note %}}
|
||||
Hugo Pipe's PostCSS requires the `postcss-cli` JavaScript package to be installed in the environment (`npm install -g postcss postcss-cli`) along with any PostCSS plugin(s) used (e.g., `npm install -g autoprefixer`).
|
||||
You must install the required Node.js packages to use the PostCSS feature. For example, to use the `autoprefixer` package, run these commands from the root of your project:
|
||||
|
||||
If you are using the Hugo Snap package, PostCSS and plugin(s) need to be installed locally within your Hugo site directory, e.g., `npm install postcss-cli` without the `-g` flag.
|
||||
{{% /note %}}
|
||||
```text
|
||||
npm install postcss postcss-cli autoprefixer
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
|
Reference in New Issue
Block a user