You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
<AbellComponent>
<template>
<!-- This code does not need to be scoped -->
<div></div>
</template>
</AbellComponent>
<AbellComponent>
<template>
<!-- This code does not need to be scoped -->
<div></div>
</template>
<styleglobal>/* global styles */</style>
</AbellComponent>
Problem:
In both of the above cases, CSS is not needed to be scoped. Above components will add abell-data-<hash> attribute to all html elements inside template.
And thus, it outputs:
<divdata-abell-kGoBAj></div>
data-abell-<hash> is required to scope CSS. But since in above examples, styles are not scoped, we can ignore adding hash to HTML elements.
Expected:
Component with this code is not required to be scoped so does not need those abell-data attributes. So they are expected to output.
saurabhdaware
changed the title
Ignore adding scope hash when there is not style tag in abell component
Ignore adding scope hash when styles are not scoped
Oct 12, 2020
Problem:
In both of the above cases, CSS is not needed to be scoped. Above components will add
abell-data-<hash>
attribute to all html elements inside template.And thus, it outputs:
data-abell-<hash>
is required to scope CSS. But since in above examples, styles are not scoped, we can ignore adding hash to HTML elements.Expected:
Component with this code is not required to be scoped so does not need those
abell-data
attributes. So they are expected to output.This is the function that adds those hashes to HTML output https://github.com/abelljs/abell-renderer/blob/main/src/parsers/component-parser.js#L158
We have to ignore calling this function if-
<style>
tag exists and hasglobal
attribute<style>
tag does not existThis is a good-first-issue so feel free to ask any additional questions in comments below
The text was updated successfully, but these errors were encountered: