Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

199
Views
Is it possible to use curly braces in vue js style segment?

I was wondering if it is possible to use curly braces for a value in the style segment in vue.js?

For example

.container {
  background: url({{ image-url }};
  color: {{ color-1 }}
}
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

There is an experimental feature to bind CSS variables provided from the script. Try this:

<template>
  <div class="text">Lorem ipsum</div>
</template>

<script>
import {ref} from 'vue'
export default {
  setup() {
    const color = ref('red');
    const image = ref('url(https://picsum.photos/200/300)');
    
    return {color}
  }
};
</script>

<style vars="{ color, image }">
.text {
  color: var(--color);
  background-image: var(--image);
}
</style>

Or try new v-bind() injection

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!