@microsoft/fast-foundation > MatchMediaStyleSheetBehavior

MatchMediaStyleSheetBehavior class

A behavior to add or remove a stylesheet from an element based on a media query. The behavior ensures that styles are applied while the a query matches the environment and that styles are not applied if the query does not match the environment.

Signature:

export declare class MatchMediaStyleSheetBehavior extends MatchMediaBehavior 

Constructors

Constructor Modifiers Description
(constructor)(query, styles) Constructs a MatchMediaStyleSheetBehavior instance.

Properties

Property Modifiers Type Description
query MediaQueryList The media query that the behavior operates on.
styles ElementStyles The styles object to be managed by the behavior.

Methods

Method Modifiers Description
with(query) static Defines a function to construct MatchMediaStyleSheetBehaviors for a provided query.