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

Handle inlineImages option #15

Open
Shy opened this issue Apr 10, 2023 · 1 comment
Open

Handle inlineImages option #15

Shy opened this issue Apr 10, 2023 · 1 comment

Comments

@Shy
Copy link

Shy commented Apr 10, 2023

Hey Tom. Really helpful library. I'm grabbing and setting a background image from imgur. Is there a way to get that inline? Is this something the combination of your last css inline repo and this one would resolve?

        <style>
            body {
                background: linear-gradient(rgba(10, 10, 10, 0.6), rgba(0, 0, 0, 0.9)),
                    repeating-linear-gradient(
                        0,
                        transparent,
                        transparent 2px,
                        black 3px,
                        black 3px
                    ),
                    url("https://i.imgur.com/someIDThatChangesOnEachPage.jpg");
                background-size: cover;
                background-position: top;
                z-index: 1;
            }
        </style>
@Tom-Bonnike
Copy link
Owner

Tom-Bonnike commented Apr 11, 2023

inline-source can inline remote files/images but only when linked through an <img> tag.

critical has an inlineImages option, so if that CSS really is critical (above the fold), it would get inlined into base64. Sadly my Netlify plugin doesn’t handle that option yet. Contributions are welcome though! critical relies on this PostCSS plugin, for what it’s worth.

@Tom-Bonnike Tom-Bonnike reopened this Apr 24, 2023
@Tom-Bonnike Tom-Bonnike changed the title Looking for recommendation for images in css. Handle inlineImages option Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants