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

[✨] feat: Add the option of pass plain css #584

Closed
TheElegantCoding opened this issue Dec 30, 2023 · 2 comments
Closed

[✨] feat: Add the option of pass plain css #584

TheElegantCoding opened this issue Dec 30, 2023 · 2 comments

Comments

@TheElegantCoding
Copy link

Critical should have the option of only pass the css and avoid all the boilerplate

generate({
  rawCss: `html{display:block;}.someclass{color:red}`
}, (err, output) => {
    console.log(output)
});

expected output:

html{display:block;}
@bezoerb
Copy link
Collaborator

bezoerb commented Jan 28, 2024

@TheElegantCoding from v7.1.0 on you should be able to also pass plain css to critical using the css option:

generate({
  css: `html{display:block;}.someclass{color:red}`
}, (err, output) => {
    console.log(output)
});

or via CLI:

critical http://my-domain.com -c 'html{display:block;}.someclass{color:red}'

@bezoerb
Copy link
Collaborator

bezoerb commented Jan 28, 2024

please verify

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants