---
id: fast-foundation.matchmediastylesheetbehavior
title: MatchMediaStyleSheetBehavior class
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-foundation](./fast-foundation.md) &gt; [MatchMediaStyleSheetBehavior](./fast-foundation.matchmediastylesheetbehavior.md)

## 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.

<b>Signature:</b>

```typescript
export declare class MatchMediaStyleSheetBehavior extends MatchMediaBehavior 
```

## Constructors

|  Constructor | Modifiers | Description |
|  --- | --- | --- |
|  [(constructor)(query, styles)](./fast-foundation.matchmediastylesheetbehavior._constructor_.md) |  | Constructs a [MatchMediaStyleSheetBehavior](./fast-foundation.matchmediastylesheetbehavior.md) instance. |

## Properties

|  Property | Modifiers | Type | Description |
|  --- | --- | --- | --- |
|  [query](./fast-foundation.matchmediastylesheetbehavior.query.md) |  | MediaQueryList | The media query that the behavior operates on. |
|  [styles](./fast-foundation.matchmediastylesheetbehavior.styles.md) |  | [ElementStyles](./fast-element.elementstyles.md) | The styles object to be managed by the behavior. |

## Methods

|  Method | Modifiers | Description |
|  --- | --- | --- |
|  [with(query)](./fast-foundation.matchmediastylesheetbehavior.with.md) | <code>static</code> | Defines a function to construct [MatchMediaStyleSheetBehaviors](./fast-foundation.matchmediastylesheetbehavior.md) for a provided query. |
