Skip to main content
Version: 3.0

📱 Responsive API

This page describes css-fx-layout's responsive API.

The responsive API allows you to create different layouts for different screen sizes using breakpoint names like xs, sm or xl.

Migration from Angular Flex-Layout

The responsive API breakpoints and media queries are equal to those used in Angular Flex-Layout.

Breakpoints

The fx-layout media queries use the following breakpoints:

NameBreakpoint
xs599px
sm959px
md1279px
lg1919px
xl5000px

Media Queries

These breakpoints result in the following media queries:

NameMedia Query
xsscreen and (max-width: 599px)
smscreen and (min-width: 600px) and (max-width: 959px)
mdscreen and (min-width: 960px) and (max-width: 1279px)
lgscreen and (min-width: 1280px) and (max-width: 1919px)
xlscreen and (min-width: 1920px) and (max-width: 5000px)
lt-smscreen and (max-width: 599px)
lt-mdscreen and (max-width: 959px)
lt-lgscreen and (max-width: 1279px)
lt-xlscreen and (max-width: 1919px)
gt-xsscreen and (min-width: 600px)
gt-smscreen and (min-width: 960px)
gt-mdscreen and (min-width: 1280px)
gt-lgscreen and (min-width: 1920px)

Mixins

You also get access to mixins named like the media break points, which you can use to apply your own styles based on the respective screen size:

@use "css-fx-layout" as fx;

// This will make the div blue on xs sized screens
div {
background-color: red;
@include fx.xs {
background-color: blue;
}
}

Usage

To learn how to use the responsive API please refer to the following pages: