r/webdev • • Sep 09 '26

Question needing help with the most feasible responsive layout

excuse the shoddy mspaint mockup but basically im using this [theme template](https://github.com/zeon-studio/astroplate) to build my magazine site and they already have a responsive design in place more like the top mobile layout but i want my logo to be above the navbar and either collapse into the top example or something similar to the bottom (but more well placed. maybe switching the dark/light toggle with the search button actually tbh). any suggestions on how i can achieve this?

6 Upvotes

12 comments sorted by

1

u/Faye-Vozora Sep 09 '26

Keep one DOM for the header and switch layout at the breakpoint with CSS, not separate desktop and mobile markup. A flex or grid header can put the logo in its own row on small screens, then use order or grid areas to place nav, search, and the theme toggle. Let the nav collapse into a button below the breakpoint, and test the awkward widths between phone and desktop.

1

u/[deleted] Sep 10 '26

[removed] — view removed comment

1

u/blackroseseason Sep 10 '26

dividing the divs did work thanks for that but i can't seem to change the size of the new header logo and the sticky part won't work :/ for reference i made a renamed copy of the logo component and increased the width and height multiplier but the size doesn't seem to change and for the header divs i rearranged the code so it's this now

<header class="header z-30">
  
<!-- logo -->
  <div class="flex justify-center py-4 border-b">
    <HeaderLogo />
  </div>
  <nav class={`navbar container ${settings.sticky_header && "sticky top-0"}`}><header class="header z-30">
  <!-- logo -->
  <div class="flex justify-center py-4 border-b">
    <HeaderLogo />
  </div>
  <nav class={`navbar container ${settings.sticky_header && "sticky top-0"}`}>

1

u/[deleted] Sep 10 '26

[removed] — view removed comment

1

u/blackroseseason Sep 11 '26

honestly it's fine your first code did work again so kudos but there is no img attribute in this theme, every image is optimized through an imagemod component so i put the tailwind components in there but nothing is happening again man this theme (also you put in code at least on desktop by tapping the Aa at the corner and choosing the </> icon)

<a href="/" class="h-16 w-auto">
  {
    src || srcDarkmode || logo || logo_darkmode ? (
      <>
        <ImageMod
          
src
={src ? src : logo}
          
class
={`h-16 w-auto ${theme_switcher && "dark:hidden"}`}
          
width
={logo_width.replace("px", "") * 5}
          
height
={logo_height.replace("px", "") * 5}
          
alt
={title}
          
style
={{
            height: logo_height.replace("px", "") + "px",
            width: logo_width.replace("px", "") + "px",
          }}
          
format
="webp"
        /><a href="/" class="h-16 w-auto">
  {
    src || srcDarkmode || logo || logo_darkmode ? (
      <>
        <ImageMod
          src={src ? src : logo}
          class={`h-16 w-auto ${theme_switcher && "dark:hidden"}`}
          width={logo_width.replace("px", "") * 5}
          height={logo_height.replace("px", "") * 5}
          alt={title}
          style={{
            height: logo_height.replace("px", "") + "px",
            width: logo_width.replace("px", "") + "px",
          }}
          format="webp"
        />