Skip to content

Image and Picture component style issues in astro dev when JS disabled #17267

Description

@paulrudy

Astro Info

Astro                    v7.0.5
Vite                     v8.1.3
Node                     v22.20.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

I'm using Astro's Image and Picture components, using layout="full-width" in both Image and Picture components, and restricting the heights of the images in CSS, then testing layout with javascript disabled. In astro dev mode, the images do not maintain their aspect ratios as expected when javascript is disabled.

After building, astro preview shows the images with the correct aspect ratios, even with javascript disabled, as expected.

What's the expected result?

If possible, astro dev should display the images with the expected aspect ratios, when javascript is disabled.

Link to Minimal Reproducible Example

https://github.com/paulrudy/astro-image-layout-test

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)triage: fix verifiedReporter confirmed the triage bot fix works

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions