DEV Community

Discussion on: A Loop can Save 60% Code on Conditional Media Query Mixins || 2021🔥

Collapse
 
joyshaheb profile image
Joy Shaheb

Point # 1 :

This blog is designed to stop code repetition. Let's say we need 5 media queries to change values of the same property. For example, we need the font-size on 5 screen sizes to be 10px, 20px, 30px, 40px, 50px. We input the values in a map, and then we use a loop, just like the one in the blog.

Point # 2 :

If you need to change a single property, in 1 media query(screen size) then just write like this.
@include query(pick_a_display_name_from_$bp){
font-size : 25px;
}

I updated this at the post at "BUT..." section.

Thank You for the feedback. Happy Coding ❤️️