SCSS usage for small and large screens
Standard Responsive Breakpoints (Based on Bootstrap & Tailwind CSS)
Name | Screen Width (px) | Usage |
---|---|---|
xs (Extra Small) | < 576px | Very small devices (phones) |
sm (Small) | 576px – 640px | Small devices (phones) |
md (Medium) | 641px – 768px | Tablets |
lg (Large) | 769px – 1024px | Small laptops |
xl (Extra Large) | 1025px – 1280px | Desktops |
2xl (Double Extra Large) | > 1280px | Large desktops |
Example of SCSS Mixin with Breakpoints
If your @include sm
is part of a mixin, it might be defined like this:
How to Use These Mixins
This means:
- On small screens (
≤ 640px
),font-size
will be14px
. - On large screens (
≤ 1024px
),font-size
will be16px
.
Comments
Post a Comment
What is your thought about this?