salesforce - Loading CSS in lightning component as static resource? -
i got salesforce design system pilot morning's webinar. uploaded package (as 'sds.zip') static resource. i'm calling css (immediately after '' in .cmp file) with:
<link href='/resource/sds/index.scss' rel="stylesheet"/>
however when attempt save error:
failed save undefined: no component named markup://use found : [markup://c:contactlist]: source
i think 'use' error refrence code block, later in .cmp file:
<svg aria-hidden="true" class="icon icon--large icon-standard-user"> <use xlink:href="/assets/icons/standard-sprite/svg/symbols.svg#user" /> </svg>
i assume i'm importing css incorrectly, what's right way it?
you importing css correctly. that's way inside lightning component. inside visualforce page <apex:stylesheet value="{!urlfor($resource.sds, '/resource/sds/index.css')}" />
.
the problem not css import vf not understanding use
, svg
tags inside component. visualforce parse tags need declare namespace adding line <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
, matching closing tag @ end. works fine if put in vf, , using svg
tag in vf.
however, if putting svg
tag inside lightning component, need create separate svg component it, described in tutorial.
Comments
Post a Comment