-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
Is it possible to have inline styles in AlpineJS? I've tried something on CodePen, but nothing was working. Consider the following code:
<div class="box" :style="{ backgroundColor: 'red' }"></div>
Assuming .box
has width: 100px;
, height: 100px
, and a background-color: 'blue'
, the code above should make the box the color of red
, but it does not.
I've tried the same code in VueJS and it did work with inline styles. Here is the same code in VueJS:
<div id="app">
<div class="box" :style="{ backgroundColor: 'red' }"></div>
</div>
Is there an extra step to consider when working with inline styles in AlpineJS? I didn't see anything mentioned about inline styles in the GitHub documentation.
Thanks for the help!
Metadata
Metadata
Assignees
Labels
No labels