Skip to content

Instantly share code, notes, and snippets.

@kcoder666
Last active June 29, 2021 03:30
Show Gist options
  • Save kcoder666/6b69212e5d00d9e9de5ac4e7cdb60498 to your computer and use it in GitHub Desktop.
Save kcoder666/6b69212e5d00d9e9de5ac4e7cdb60498 to your computer and use it in GitHub Desktop.
Compare Vue CSS
<template>
<div class="card">
<div class="card__header">
{{title}}
</div>
<div class="card__body">
<p>{{description}}</p>
</div>
<div class="card__footer">
{{date}}
</div>
</div>
</template>
<script>
export default {
props: {
title: String,
description: String,
date: String,
}
}
</script>
<style lang="postcss" scoped>
.card {
@apply flex items-start justify-between;
width: 400px;
&__header {
@apply font-bold italic text-6xl;
}
&__body {
@apply text-lg;
}
&__footer {
@apply text-sm text-gray-400;
}
}
</style>
<template>
<div class="flex items-start justify-between" :style="{width: '400px'}">
<div class="font-bold italic text-6xl">
{{title}}
</div>
<div class="text-lg">
<p>{{description}}</p>
</div>
<div class="text-sm text-gray-400">
{{date}}
</div>
</div>
</template>
<script>
export default {
props: {
title: String,
description: String,
date: String,
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment