DEV Community

loading...

Discussion on: Web Developers and Designers, where do you get your raw materials from?

rixcy profile image
Rick Booth

For a grid I usually just use tailwind's built in width stuff, having a two column layout would be something like

<div class="flex flex-col md:flex-row">
  <section class="w-1/3">Sidebar</section>
  <section class="w-2/3">Main Content</section>
</div>

where initially it wraps and on medium screens and above it sits side by side.

I've found the responsive stuff in tailwind to be great. You can even hook directly in to the config if configured properly and do stuff like

.my-component {
  @apply bg-red text-white p-4;
  @screen md {
    font-family: config('fonts.primary');
    @apply bg-blue text-grey p-8 /* font-primary here would do the same as the above line */;
  }
}

As for stuff like modals, it's not too hard to achieve these in pure css without needing javascript or pre-built component (I know Bootstrap used to rely pretty heavily on jQuery which was one of the main reasons I moved away from it when starting to use stuff like Vue/React). Check out tailwindcomponents if you get chance, there's a load of pre built tailwind things there that you can either get inspiration from or copy :)

I wasn't that confident with CSS stuff until more recently and using tailwind has been a blessing.

Forem Open with the Forem app