question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a way to stop the component inserting inline css with the image? I’m using this to load a bg image, the layout=fill has worked, just wanted to clean it up a bit.

Something like layout="none" maybe?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
IanVScommented, Jun 1, 2022

I’m also struggling a little bit here, due to the display: inline-block; being set inline on the Img component. I want to center the image, and I’m trying to use a css class to set display: block; margin: 0 auto;, but the inline styles are winning out. I can add it as a style in attributes.img, but that just feels like escalating the specificity wars, and doesn’t feel very scalable.

That said, adding more options to what are already a huge set of options, feels a bit wrong. I wonder if it would be possible to use normal css classes to do the internal astro-imagetools styling, rather than inline styles, which would at least make it possible to easily override the styles while keeping a default behavior.

2reactions
bronzecommented, Mar 4, 2022

I’m just inserting the image component with absolute positioning and object-fit behind my content. [Github link] [Live Link]

I was a bit surprised after inserting the image that it didnt keep its full page proportions (hadnt seen the inline style yet). The fill essentially worked the same, just had it all done before on css.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Layout designs, themes, templates and downloadable ...
Layout. 71,448 inspirational designs, illustrations, and graphic elements from the world's best designers. Want more inspiration? Browse our search results.
Read more >
Layout mode - CSS: Cascading Style Sheets - MDN Web Docs
A CSS layout mode, sometimes called layout, is an algorithm that determines the position and size of boxes based on the way they...
Read more >
Layout patterns - web.dev
A collection of layout patterns built using modern CSS APIs that will help you build common interfaces such as cards, dynamic grid areas,...
Read more >
Layout and Styles - Build Beautiful Forms
Edit form styles. Create two column forms. Multi column forms. Easily adjust form layout. You don't need a designer, just Layout and Styles!...
Read more >
The Basics of Page Layout Design (+25 ...
Truth is, I didn't understand page layout design or how to put together a webpage that conveyed my intended message and was visually...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found