4

I'm trying to create a share css style rule for my lwc components following the doc and it doesn't work

I created a LWC component like this

myStyle 
  --myStyle.css
  --myStyle.js-meta.xml

myStyle.css

:host() {
   --my-color: red; 
}

myStyle.js-meta.xml

<?xml version="1.0" encoding="UTF-8" ?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
    <apiVersion>49.0</apiVersion>
    <isExposed>false</isExposed>
</LightningComponentBundle>

But when I tried to deploy this, I see this error

Error force-app/main/default/lwc/myStyle/myStyle.js-meta.xml No base file for markup://c:myStyle

And it deletes my files!!!

I added the Javascript and HTML files and when I tried to import the css module in another component I get this error: Unknown ref type slds for ref c/myStyle in file..

The doc also it's not very clear. What is the difference between the lwc component described in step 1 and the component in step 2?

https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.create_components_css_share

1
  • Did you find a solution to this ?
    – Shamina
    Commented Jul 29, 2020 at 14:30

1 Answer 1

0

The problem was fixed in newer versions. After Summer ’20 is working

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .