Loading...
Vue.js framework with Composition API and Vue Router
Navigate to your downloaded project directory
cd your-project-nameInstall all dependencies
npm installStart the development server
npm run devYour Vue 3 project uses the Composition API with color variables in src/assets/main.css.
All colors are defined as CSS custom properties:
:root {
--primary: /* Your primary color */;
--secondary: /* Your secondary color */;
--accent: /* Your accent color */;
--text-on-primary: /* Text color for primary bg */;
--text-on-secondary: /* Text color for secondary bg */;
--text-on-accent: /* Text color for accent bg */;
}Apply colors in the <style> section:
<template>
<div class="card">
<h2>Card Title</h2>
</div>
</template>
<style scoped>
.card {
background-color: var(--secondary);
color: var(--text-on-secondary);
}
</style>Use :style binding for dynamic colors:
<div :style="{
backgroundColor: 'var(--primary)',
color: 'var(--text-on-primary)'
}">
Content
</div>