Function: Shared()

function Shared<T>(target: T, context?: ClassDecoratorContext<(...args: any) => any>): T;

Defined in: src/styles/decorators/scope.ts:36

Marca una clase de estilos como compartida globalmente. Los estilos

Type Parameters

Type Parameter
T extends (…args: any[]) => { }

Parameters

Parameter Type
target T
context? ClassDecoratorContext<(…args: any) => any>

Returns

T

Shared

se insertan en todos los shadow roots de la aplicación.

Uso:

@Shared
class GlobalTheme extends BaseStyleSheet {
  styles() {
    return (
      <>
        <Rule selector=":host">
          color: {() => this.theme.primaryColor};
        </Rule>
      </>
    );
  }
}