Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where to apply basic styles (Nuxt 3) #115

Open
galaxyblur opened this issue Nov 28, 2023 · 3 comments
Open

Where to apply basic styles (Nuxt 3) #115

galaxyblur opened this issue Nov 28, 2023 · 3 comments

Comments

@galaxyblur
Copy link

Thanks for the interesting tool! I'm intrigued by the concept and looking forward to playing with it in my app.

I'm developing a new Nuxt 3 app and I've gotten as far as having the CSS variables available in the browser. I'm confused by what to do now -- should I be setting up the base CSS rules in something like app.vue? For example, my app's fontFamily? Apologies if I missed this somewhere in the docs.

@MrHBS
Copy link

MrHBS commented Dec 7, 2023

Same question here

@SGAMERyu
Copy link
Contributor

SGAMERyu commented Dec 8, 2023

pinceau can distinguish between style logic and code logic in different blocks, and we often have such code in our applications

<template>
 <div :style={ color: props. color } class="test"></div>
</template>

<script lang="ts" setup>
defineProps<{ color: string}>()
</script>

<style>
.test {
....
}
</style>

pinceau provides a solution that provides all dynamic styles in a style block

<template>
 <div class="test"></div>
</template>

<script lang="ts" setup>
defineProps<{ color: string}>()
</script>

<style lang="ts">
.test {
color: () => props.color
}

I think this solves the problem of having too much style in the logic of the component, allowing developers to switch between focusing on style and focusing on logic

@galaxyblur
Copy link
Author

@SGAMERyu yes, I see the value in this tool. But what is the suggested pattern for setting up default/global styles in a Nuxt 3 app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants