angular / angular/angular

feat: `::part` support in Angular's Emulated CSS parser

Ouverte
#22,515 7 commentaires 46 réactions 0 personnes assignées Voir sur GitHub
area: core core: CSS encapsulation feature feature: under consideration
Langage dominant
TypeScript
Étoiles
101k
Forks
27.5k
Merge moyen
1 j 19 h
PR mergées (30 j)
288

Description

## I'm submitting a...



[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[x ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

## Current behavior
Angular has no real replacement for the deprecated /deep/ (aka >>> and ::ng-deep) which are all marked as deprecated.

## Expected behavior
Angular should be at the forefront of web technology and provide today the technologies of tomorrow.
::part and ::theme provide a controlled and safe way to style components from outside without allowing abuse to the encapsulation that Shadow DOM is meant to provide.
[Explaining article](https://meowni.ca/posts/part-theme-explainer/)
[Spec Draft](https://tabatkins.github.io/specs/css-shadow-parts/#intro)

I would believe that such declared parts can be treated almost like @Input variables that trigger change detection. Although declared on the @Component style part they will be compiled into the .ngstyle and be incoparated in the view. when another component uses the ::part annotated component the styles are propagated.

## What is the motivation / use case for changing the behavior?
a component needs to allow external users to style its inner parts, let say a dropdown needs to have it's button, drop-down list & selection hover styleable.

Angular version: 5.2.6

Browser: Any, it should compile away to allow browsers to support it today.

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par localiser l’analyseur CSS Emulated d’Angular et le traitement des styles de @Component qui produit la sortie .ngstyle. Comparez le comportement demandé pour ::part et ::theme avec la spécification CSS Shadow Parts liée, et déterminez la sémantique de propagation requise. Le travail sera considéré comme terminé lorsqu’une définition concrète et testée de la manière dont les parts déclarées sont compilées et stylées depuis l’extérieur d’un composant sera disponible.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
typescript
Domaine
frontend
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.