How to resolve the error - at rule or selector expected?

440    Asked by darsh_6738 in Salesforce , Asked on May 1, 2023
HTML->

JS->

import { LightningElement,api } from 'lwc'; export default class LwcPropertyTile extends LightningElement { @api property; get backgroundImageStyle() { return `background-image:url(${this.property.Thumbnail__c})`; } }
Answered by David Edmunds
To resolve the error -  at rule or selector expected -

As I don't see an import statement in the JS file. Add below in the first line of js
import { LightningElement, api} from 'lwc';
If that doesn't solve, turn off the HTML > Validate:Styles in the VS code settings.


Your Answer

Interviews

Parent Categories