Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store CSS hashed attribute in a variable #375

Closed
Rich-Harris opened this issue Mar 15, 2017 · 0 comments · Fixed by #733
Closed

Store CSS hashed attribute in a variable #375

Rich-Harris opened this issue Mar 15, 2017 · 0 comments · Fixed by #733

Comments

@Rich-Harris
Copy link
Member

A nice easy win — currently if you have a component with CSS, top-level elements get this treatment:

setAttribute( div, 'svelte-3599223440', '' );

If there's more than one top-level element, it would make more sense to do this instead:

var cssAttr = 'svelte-3599223440';
// ...
setAttribute( div, cssAttr, '' );

Or even

function encapsulateStyles ( node ) {
  div.setAttribute( 'svelte-3599223440', '' );
}
// ...
encapsulateStyles( div );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant