Skip to content

Instantly share code, notes, and snippets.

@ryanmr
Created February 27, 2024 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanmr/3b0fbb6d3d5ee9a5eee5546516c22964 to your computer and use it in GitHub Desktop.
Save ryanmr/3b0fbb6d3d5ee9a5eee5546516c22964 to your computer and use it in GitHub Desktop.
an example of css modules vs tailwind; why not both in some cases?
<template>
<div class="app-wrapper">
<app-header></app-header>
<main class="main-content">
<slot></slot>
</main>
<app-footer></app-footer>
</div>
</template>
<style module>
.app-wrapper {
min-height: 100vh;
display: grid;
grid-template-rows: min-content 1fr min-content;
}
.main-content {
display: flex;
flex-direction: column;
}
</style>
<!-- --------
---- OR -----
--------- -->
<template>
<div class="min-h-screen grid grid-rows-[min-content_1fr_min-content]">
<app-header></app-header>
<main class="flex flex-col">
<slot></slot>
</main>
<app-footer></app-footer>
</div>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment