Thursday, 14 January 2021

how can use hsl instead of rgb for scss global declaration javascript api

that's how my next.config.js look like

// next.config.js

const env = require('./site.config').env;
const Colour = require('sass').types.Color;
const {r, g, b} = require('./site.config').customProperties;

const withBundleAnalyzer = require('@next/bundle-analyzer')({enabled: !!process.env.ANALYZE});

const config = {
  env: {
    ...env,
  },
  sassOptions: {
    functions: {
      'primaryOpacityColour()': function(){
        return new Colour(r, g,b)
        // here I want to return Colour in hsl form
      },
    },
  },
};

module.exports = withBundleAnalyzer(config);

I'm not able to return Colour in hsl form, can anyone please help me how to resolve this issue?



from how can use hsl instead of rgb for scss global declaration javascript api

No comments:

Post a Comment