Today I Learned

TIL, 2022-07-04, CSS at rules

  • CSS at-rules.

Reference

  • No way to easily disable Tailwind because of @apply.

Reference

  • Reference - Do process.env here. Anything gets exposed to the Angular process as long as its passed from outside.

  • Persistent build cache: Reference

const { execSync } = require('child_process');
const { readFileSync, writeFileSync } = require('fs');

function rdWhitelabels() {
  const partnersJsonContents = readFileSync('partners.json', 'utf8');

  return Object.values(JSON.parse(partnersJsonContents)).flat();
}

function modifyWhitelabel() {
  const branchTriggeringPrefixes = rdWhitelabels();
  console.log(branchTriggeringPrefixes);

  branchTriggeringPrefixes.forEach((branch) => {
    let newFile;

    const cssFile = readFileSync(
      `projects/${branch}/src/stylesheets/${branch}-global.scss`,
      { encoding: 'utf8', flag: 'r' },
    );

    newFile = "@use 'tailwind-declarations';" + '\n' + cssFile;

    console.log(newFile);

    writeFileSync(
      `projects/${branch}/src/stylesheets/${branch}-global.scss`,
      newFile,
    );
  });
}

modifyWhitelabel();

This project is maintained by daryllxd