0.5.13 • Published 3 years ago

@goldpage/postcss v0.5.13

Weekly downloads
15
License
-
Repository
github
Last release
3 years ago

Goldpage + PostCSS = :heart:

@goldpage/postcss

Use Goldpage with PostCSS.

Usage

Install @goldpage/postcss.

$ npm install @goldpage/postcss

The @goldpage/postcss plugin is automatically loaded.

Configure PostCSS:

module.exports = {
  // All options defined here are passed down as options for `postcss-loader`.
  // Thus, this is where you add PostCSS plugins, a PostCSS parser, etc.
  postcss: {
    plugins: [
      require('postcss-cssnext')()
    ],
    parser: 'sugarss',
  },
};

Example

// ./example/pages/landing.css

:root
  --red: #f88
  --blue: #88f

.red-on-blue
  background-color: var(--blue)
  color: var(--red)

.blue-on-red
  background-color: var(--red)
  color: var(--blue)

.red-on-blue,
.blue-on-red
  font-size: 2em
  width: 300px
  padding: 20px
  margin: 10px
// ./example/pages/landing.page.js

import React from 'react';
import './landing.css';

const LandingComponent = () => (
  <div>
    <div className="blue-on-red">
      Blue on red.
    </div>
    <div className="red-on-blue">
      Red on blue.
    </div>
  </div>
);

const LandingPage = {
  route: '/',
  view: LandingComponent,
  renderToDom: false,
  renderToHtml: true,
};

export default LandingPage;
// ./example/goldpage.config.js

module.exports = {
  // All options defined here are passed down as options for `postcss-loader`.
  // Thus, this is where you add PostCSS plugins, a PostCSS parser, etc.
  postcss: {
    plugins: [
      require('postcss-cssnext')()
    ],
    parser: 'sugarss',
  },
};
0.5.12

3 years ago

0.5.13

3 years ago

0.5.11

4 years ago

0.5.10

4 years ago

0.5.9

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.6

4 years ago

0.5.5

5 years ago

0.5.4

5 years ago

0.5.3

5 years ago

0.5.2

5 years ago

0.5.1

5 years ago

0.5.0

5 years ago