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

DOM Parts / Template Parts: conflicting name with CSS parts #950

Closed
dy opened this issue Jan 4, 2022 · 1 comment
Closed

DOM Parts / Template Parts: conflicting name with CSS parts #950

dy opened this issue Jan 4, 2022 · 1 comment

Comments

@dy
Copy link

dy commented Jan 4, 2022

There's part attribute / CSS pseudo for custom elements:

<template id="tabbed-custom-element">
<div part="tab active">{{ tab[0] }}</div>
<div part="tab">{{ tab[1] }}</div>
<div part="tab">{{ tab[2] }}</div>
</template>

<tabbed-custom-element></tabbed-custom-element>

<style>
tabbed-custom-element::part(tab) {
  color: #0c0dcc;
  border-bottom: transparent solid 2px;
}

tabbed-custom-element::part(active) {
  background-color: #0c0d19;
}
</style>

If we wanted to have access to all element parts, that could be implemented as el.part.tab.
Same time, it would conflict by meaning with DOM/Template parts, had the proposal been promoted - here parts have meaning fields: el.parts.tab[0] = 'Tab1'

@dy
Copy link
Author

dy commented Jan 4, 2022

Duplicate #902

@dy dy closed this as completed Jan 4, 2022
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

No branches or pull requests

1 participant