Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.55 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.55 KB

webpack-sass-theme-loader

This library has 3 goals

  • running and passing @hungry/bulma-theme to sass-var-loader
  • detecting automatically sass rule within webpack config and inject it into the correct place
  • decamelize all theme variables and transform theme before applying it to sass-var-loader

Docs

How to use

Using with @hungry/bulma-theme

To apply on webpack config object you need to provide theme and config like so,

  import { enableSassTheming } from '@hungry/webpack-sass-theme-loader'
  import { theme } from '@hungry/bulma-theme'

  const webpackConfig = {} 
  const withEmbededTheme = enableSassTheming(theme)(webpackConfig)

Custom theme from scratch

Follow @hungry/bulma-theme - provide similar interface, this is type RunnableTheme = Reader<InjectedMethods, BulmaTheme> or just reader.of({/* your camelcased variables */})

Implementation details

@hungry/bulma-theme is a wrapped function by Reader monad - which provide ability to mapping and chaining. This is, you can remap any variable by using map or chain, but at this level such changes are not necessary as any alteration should be part of theming function.