github.com/rabbouni145/gg@v0.47.1/docs/content/en/hugo-pipes/postcss.md (about)

     1  ---
     2  title: PostCSS
     3  description: Hugo Pipes can process CSS files with PostCSS.
     4  date: 2018-07-14
     5  publishdate: 2018-07-14
     6  lastmod: 2018-07-14
     7  categories: [asset management]
     8  keywords: []
     9  menu:
    10    docs:
    11      parent: "pipes"
    12      weight: 40
    13  weight: 40
    14  sections_weight: 40
    15  draft: false
    16  ---
    17  
    18  
    19  Any asset file can be processed using `resources.PostCSS` which takes for argument the resource object and a slice of options listed below. 
    20  
    21  The resource will be processed using the project's or theme's own `postcss.config.js` or any file set with the `config` option.
    22  
    23  
    24  ```go-html-template
    25  {{ $css := resources.Get "css/main.css" }}
    26  {{ $style := $css | resources.PostCSS }}
    27  ```
    28  
    29  {{% note %}}
    30  Hugo Pipe's PostCSS requires `postcss-cli` javascript package to be installed on the environement along with any PostCSS plugin used.
    31  {{% /note %}}
    32  ### Options
    33  
    34  config [string]
    35  : Path to the PostCSS configuration file
    36  
    37  noMap [bool]
    38  : Default is `true`. Disable the default inline sourcemaps
    39  
    40  _If no configuration file is used:_
    41  
    42  use [string]
    43  : List of PostCSS plugins to use
    44  
    45  parser [string]
    46  : Custom PostCSS parser
    47  
    48  stringifier [string]
    49  : Custom PostCSS stringifier
    50  
    51  syntax [string]
    52  : Custom postcss syntax
    53  
    54  ```go-html-template
    55  {{ $style := resources.Get "css/main.css" | resources.PostCSS (dict "config" "customPostCSS.js" "noMap" true) }}
    56  ```