Can a sass/css class with an ampersand be used in conjunction with VueJS effectively? I've noticed that the CSS attribute assigned on the ampersand works, but the root element itself isn't detected by the browser.
<style lang="scss" scoped>
.curved-input {
border-radius: 5px;
height: 50px;
margin-right: 1rem;
&__lg {
width: 300px;
}
&__sm {
width: 150px;
}
}
</style>
The browser appears to detect the width: 300px
or width: 150px
, but not the
border-radius, height, margin-right
attributes.
<input name="city" class="curved-input__lg" type="text" placeholder="Palau Ujong, Singapore"/>
The textbox width changes, but other attributes are not displayed when inspecting them in the browser tools. Am I overlooking something here?
My objective is to avoid coding it as
class="curved-input curved-input__lg
and instead only utilize curved-input__lg
or curved-input__sm
while inheriting the parent attributes (curved-input).