-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(css): add shadow part detection
add shadow part detection to the output target. similar to stencil's auto generation of docs data, we pull the shadow part information from the compiler metadata. a new example was added to the project to showcase how shadow parts work and where autocompletion can help the development experience here. the readme was updated to clarify scenarios where overriding the local dependency might not give the latest/greatest features. unused styles from my-component (where i originally intended to showcase this functionality) has been removed
- Loading branch information
1 parent
b5d4821
commit 12c5813
Showing
10 changed files
with
306 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component, h } from '@stencil/core'; | ||
|
||
/** | ||
* An example using Shadow Parts. | ||
* | ||
* The 'label' part is declared in the component-level JSDoc using "@part NAME - DESCRIPTION". | ||
* | ||
* @part first-msg - The text describing the first message of the component. | ||
* @part second-msg - The text describing the second message of the component. | ||
*/ | ||
@Component({ | ||
tag: 'shadow-parts', | ||
styles: 'div { background: LightGray; }', | ||
shadow: true, | ||
}) | ||
export class ShadowParts { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<div part="first-msg">I am styled with Shadow Parts!</div> | ||
<div part="second-msg">I am also styled with Shadow Parts!</div> | ||
<div>I am not styled with Shadow Parts</div> | ||
</div> | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.