Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sass support #38

Open
TheJaredWilcurt opened this issue Oct 31, 2020 · 0 comments
Open

Sass support #38

TheJaredWilcurt opened this issue Oct 31, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed needs discussion
Projects

Comments

@TheJaredWilcurt
Copy link
Member

TheJaredWilcurt commented Oct 31, 2020

We could add in functionality to detect if a style input is .scss or .sass. Or have a type option for data.

redPerfume.atomize({
  tasks: [
    {
      styles: {
        in: [
          './styles/file.scss',
          './styles/style.css',
          './styles/stuff.sass'
        ],
        out: './dist/styles/styles.css'
      }
    },
    {
      styles: {
        data: '$cow: #F00; .moo { color: $cow; }',
        type: 'scss',
        out: './dist/styles/custom.css'
      }
    }

  ]
});

Implementation:

  1. Detect the input type by str.endsWith('.sass') or str.endsWith('.scss').
  2. Run the file through a Sass processor to create CSS (likely sass.js or a dart-sass binary since node-sass is no more)
  3. Atomize the CSS like normal
  4. If we allow strings of Sass to be passed in via data, then there needs to be a type or language or syntax or something that defaults to css, but allows sass and scss to be passed in as options.

Questions:

  1. Should we allow users to pass in sass.js/dart-sass specific options?
  2. What would that look like in the API?
  3. Some options will need to be handled by Red-Perfume anyway, like using indentedSyntax setting for .sass
@TheJaredWilcurt TheJaredWilcurt added enhancement New feature or request help wanted Extra attention is needed needs discussion labels Oct 31, 2020
@TheJaredWilcurt TheJaredWilcurt added this to Backlog in Red Perfume Oct 31, 2020
Red Perfume automation moved this from Backlog to Done or closed Dec 27, 2020
Red Perfume automation moved this from Done or closed to Backlog Dec 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed needs discussion
Projects
Status: Backlog
Red Perfume
  
Backlog
Development

No branches or pull requests

1 participant