0.4.13 • Published 5 years ago

golden-css v0.4.13

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Golden CSS

A golden-ratio preset for Bootstrap styles

npm version

How to use

Install

yarn add golden-css -D or npm install golden-css --dev

Import

app.scss

@import '~golden-css/scss/base';
@import '~golden-css/scss/golden';

Or, for more versatility:

app.scss

@import 'base';
@import '~golden-css/scss/golden';

_base.scss

@import 'variables'; // or whatever functions/mixins you may have
@import '~golden-css/scss/base';

Now, you can use _base.scss to have access to all variables in a scoped component without class definitions being repeated.

Debug help

The seemingly random css values (e.g. padding: 2.42705rem) can be hard to debug. With some small configuration, you can change it to show a much more friendlypadding: var(--spacer-5).

To set this up, you'll need to inject an $environment variable from webpack.

NOTE: Use the CSS calc function when doing any arithmetic so it work for css variables AND sass variables. e.g. calc(#{$spacer-1} * 2)

For Laravel Mix

Update your sass line in webpack.mix.js to this:

mix.sass('resources/sass/app.scss', 'public/css', {
        data: `$environment: '${process.env.NODE_ENV}';`,
    })

For VueCLI

Add this to your vue.config.js

module.exports = {
    // ...
    
    css: {
        loaderOptions: {
            sass: {
                prependData: `$environment: '${process.env.NODE_ENV}';`,
            },
        },
    },

    // ...
}
0.4.13

5 years ago

1.4.12

5 years ago

1.4.11

5 years ago

1.4.10

5 years ago

1.4.9

5 years ago

1.4.8

5 years ago

1.4.7

5 years ago

1.4.6

5 years ago

1.4.5

5 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

6 years ago

1.4.0

6 years ago