Debian Codegraph @

test/dart-sass/dart-sass.js

raw symbols SCIP
1 const fs = require('fs');
2 const path = require('path');
3 const sass = require('sass');
4 const utils = require('../utils');
5
6 const DART_BASE_PATH = 'test/dart-sass/build/';
7
8 fs.mkdir(DART_BASE_PATH, { recursive: true }, (err) => {
9 if (err) throw err;
10 });
11
12 const exportDartCSS = (filepath, options) => {
13 utils.exportCSS(sass, fs, DART_BASE_PATH, filepath, options)
14 }
15
16 // Full import
17
18 exportDartCSS('bulma', {
19 file: './bulma.sass',
20 });
21
22 exportDartCSS('bulma-rtl', {
23 file: './bulma-rtl.sass',
24 });
25
26 // Custom import
27
28 fs.mkdir(`${DART_BASE_PATH}custom`, { recursive: true }, (err) => {
29 if (err) throw err;
30 });
31
32 utils.exportCSS(sass, fs, DART_BASE_PATH, 'custom/navbar', {
33 data: '@use "./sass/components/navbar.sass" with ( $scheme-main: red );',
34 });
35
36 // Single imports
37
38 const BULMA_IMPORT_PATH = `./sass/`;
39
40 utils.SOURCES.forEach((source) => {
41 const parsed = path.parse(source);
42
43 fs.mkdir(`${DART_BASE_PATH}${parsed.dir}`, { recursive: true }, (err) => {
44 if (err) throw err;
45 });
46
47 exportDartCSS(`${parsed.dir}/${parsed.name}`, {
48 data: `@use "${BULMA_IMPORT_PATH}${source}";`,
49 });
50 });