twostraws / Ignite

A static site generator for Swift developers.
MIT License
915 stars 30 forks source link

Feature Request: Mobile Optimization #7

Closed Mcrich23 closed 1 week ago

Mcrich23 commented 1 month ago

I am looking at the sites on mobile and the header is NavBar is covering the top on the page content:

imageimage

Mcrich23 commented 1 month ago

Maybe add access to the width of the page via @Environment?

fbartho commented 1 month ago

@Mcrich23 @Environment will be a build-time value provider (this is a static site generator). Runtime logic must be embedded in CSS or JS, as Swift isn’t running when the browser loads the page.

Mcrich23 commented 1 month ago

I understand, I meant @Environment or something else would be used and then on compile, it would set css for elements using it.

twostraws commented 1 week ago

I have adjusted the IgniteSamples repository to provide an example of how this can be solved with CSS: https://github.com/twostraws/IgniteSamples/blob/414fe428a74e92227012c31d77dab9b2a1742830/Sources/Components/NavBar.swift#L14

That should resolve this issue fully, so I'm to close it. However, if you still have problems please re-open!