Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

How to add the code inline instead of embedded #105

Closed
GreedHub opened this issue May 16, 2022 · 3 comments
Closed

How to add the code inline instead of embedded #105

GreedHub opened this issue May 16, 2022 · 3 comments

Comments

@GreedHub
Copy link

Hi, I'm trying the library with NextJs but, along other libraries that I've tried so far, the css it's actually generated on a style tag on the head of the HTML, even when they say that the css will be inlined.

I actually need the code to be inline because I need to make mail templates.

Am I using it wrong? Is there any way to get the code from a css file and adding it inline in the tags?

@rschristian
Copy link
Contributor

That's what inlining is, taking the CSS from the external stylesheet and add it into the HTML doc (usually to avoid FOUC).

It sounds like you're asking about converting the CSS stylesheet into the style attribute on every element? Yes, that's not what this is for nor does it really help facilitate that (at least, not in a meaningful way, though it could potentially be used as an intermediary I suppose)

@developit
Copy link
Collaborator

Not sure if it's helpful, but it seems like you're looking for something like this:

https://jsfiddle.net/developit/31kpgd0n/

You could use JSDOM to make it run on the server.

@kara
Copy link
Collaborator

kara commented Oct 25, 2024

Closing this issue because ownership of Critters has moved to the Nuxt team, who will be maintaining the project going forward. This repo is archived and won't receive any future updates.

If the issue is still relevant, please re-post it to the actively-maintained fork at https://github.com/danielroe/beasties.

@kara kara closed this as completed Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants