How to use the sass.render function in sass

To help you get started, we’ve selected a few sass examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github izelnakri / mber / lib / builders / build-css.js View on Github external
import util from 'util';
import fs from 'fs-extra';
import chalk from 'ansi-colors';
import sass from 'sass';
import Console from '../utils/console.js';
import countTime from '../utils/count-time.js';
import findProjectRoot from '../utils/find-project-root.js';
import lookup from '../utils/recursive-file-lookup.js';
import say from '../utils/say.js';
import { formatTimePassed, formatSize } from '../utils/asset-reporter.js';

const compileScssAsync = util.promisify(sass.render);

export default function(buildConfig={
  applicationName: null,
  buildCache: {
    vendorAppends: '', vendorPrepends: '', applicationAppends: '', applicationPrepends: ''
  },
  cliArguments: {},
  ENV: {},
  indexHTMLInjections: {},
  projectRoot: null,
}) {
  return new Promise(async (resolve, reject) => {
    Console.log(chalk.yellow('BUILDING:'), 'application.css...');

    const projectRoot = buildConfig.projectRoot || await findProjectRoot();
    const ENV = buildConfig.ENV || {};
github izelnakri / mber / lib / builders / build-documentation-css.js View on Github external
import util from 'util';
import fs from 'fs-extra';
import chalk from 'ansi-colors';
import sass from 'sass';
import Console from '../utils/console.js';
import countTime from '../utils/count-time.js';
import findProjectRoot from '../utils/find-project-root.js';
import lookup from '../utils/recursive-file-lookup.js';
import say from '../utils/say.js';
import { formatTimePassed, formatSize } from '../utils/asset-reporter.js';
import { dirname } from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));

const compileScssAsync = util.promisify(sass.render);

export default function(buildConfig={
  applicationName: null,
  buildCache: {
    vendorAppends: '', vendorPrepends: '', applicationAppends: '', applicationPrepends: ''
  },
  cliArguments: {},
  ENV: {},
  indexHTMLInjections: {},
  projectRoot: null,
}) {
  return new Promise(async (resolve, reject) => {
    Console.log(chalk.yellow('BUILDING:'), 'documentation.css...');

    const projectRoot = buildConfig.projectRoot || await findProjectRoot();
    const ENV = buildConfig.ENV || {};
github jasonsanjose / brackets-sass / node / 2.0.1 / node_modules / node-sass / node_modules / mocha / node_modules / jade / jade.js View on Github external
sass: function(str){
    str = str.replace(/\\n/g, '\n');
    var sass = require('sass').render(str).replace(/\n/g, '\\n');
    return '<style type="text/css">' + sass + '</style>'; 
  },
github bminer / node-blade / lib / filters.js View on Github external
exports['sass'] = function(text) {
	return '<style type="text/css">\n' +
		require('sass').render(text) +
		'\n</style>';
};
github netbeast / api / node_modules / mocha / node_modules / jade / lib / filters.js View on Github external
sass: function(str){
    str = str.replace(/\\n/g, '\n');
    var sass = require('sass').render(str).replace(/\n/g, '\\n');
    return '<style type="text/css">' + sass + '</style>'; 
  },
github gaffa-tape / gaffa / examples / node / node_modules / jade / jade.js View on Github external
sass: function(str){
    str = str.replace(/\\n/g, '\n');
    var sass = require('sass').render(str).replace(/\n/g, '\\n');
    return '<style type="text/css">' + sass + '</style>'; 
  },
github ryanelian / instapack / bin / SassBuildTool.js View on Github external
return new Promise((ok, reject) => {
            sass.render(options, (error, result) => {
                if (error) {
                    reject(error);
                }
                else {
                    ok(result);
                }
            });
        });
    }
github josiahruddell / webnote5 / node_modules / jade / jade.js View on Github external
sass: function(str){
    str = str.replace(/\\n/g, '\n');
    var sass = require('sass').render(str).replace(/\n/g, '\\n');
    return '<style>' + sass + '</style>'; 
  },
github cdapio / cdap / tools / node_modules / groc / node_modules / jade / jade.js View on Github external
sass: function(str){
    str = str.replace(/\\n/g, '\n');
    var sass = require('sass').render(str).replace(/\n/g, '\\n');
    return '<style type="text/css">' + sass + '</style>'; 
  },
github easylogic / bootstrap-writer / javascript / requirejs.plugin / jade-0.25.js View on Github external
sass: function(str){
    str = str.replace(/\\n/g, '\n');
    var sass = require('sass').render(str).replace(/\n/g, '\\n');
    return '<style type="text/css">' + sass + '</style>'; 
  },