Ahmad Awais

NAVIGATE


SHARE


Introducing ReSass β€” A Sassy Responsive Mixin for 8 Screen Sizes!

Ahmad AwaisAhmad Awais

After getting requested many times, I spent some time tonight to publish my simple but pretty effective Sass mixin for designing responsive sites with CSS β€” I call it ReSass.

πŸš€ ReSass on GITHUB: β˜… 64 β‘‚ 4 β†’#

ReSassΒ β€” Sass SCSS Responsive Media Queries Mixin for Eight Different Screen Sizes! πŸ’»πŸ“±πŸ–₯
A FOSS (Free & Open Source Software) project. Maintained by @AhmadAwais.

ReSass by Ahmad Awais

⚑️ Introducing ReSass!#

ReSass (ResponsiveSass) creates responsive media queries for seven different screen sizes. These are based on min-width which means if x (x could be 240, 320, 480, 768, 1024, 1140, 1280, or 1500Β in pixels) is the size then your CSS will affect any device with screen width x and above.

USAGE:#

ReSass.gif#

CSS content goes inside {} brackets. These mixins should be used inside a class definition.

@include r(240) { }
@include r(320) { }
@include r(480) { }
@include r(768) { }
@include r(1024) { }
@include r(1140) { }
@include r(1280) { }
@include r(1500) { }

The following CSS will hide the .header on screen width 320px and above.

.header {
@include r(320) { display: none; }
}

⚑️ Getting Started!#

Getting started is very easy.

  1. Download the raw resass.scss
  2. Import the resass.scss in your main .SCSS file β†’ @import "path/to/resass";
  3. Now use any or all of the mixins inside a class’ CSS.
  4. Here’s a fun implementation at CodePen β†’

See the Pen Sass SCSS Responsive Mixin For 8 Different Screen Sizes by Ahmad Awais (@ahmadawais) on CodePen.

🌟 Star On GitHub!#

Go ahead and star the ReSass repository at GitHub to show your appreciation and to keep up with the updates.

Awesome developers/designers will Tweet about ReSass.

πŸš€ ReSass on GITHUB: β˜… 64 β‘‚ 4 β†’#

Cheers!

Founder & CEO of ⌘ Command Code, the most used coding agent for open models: 160K+ users, 50K+ paying customers. Founded Langbase (AI cloud for agents with memory & tools).

"What an awesome example for developers." β€” Satya Nadella, CEO of Microsoft, on my NASA Ingenuity code.

NASA Ingenuity Mars Helicopter code contributor Β· 6Γ— GitHub Star, one of the first 8 Gold Stars Β· #1 trending JavaScript developer on GitHub Β· 6Γ— Google Developer Expert Β· 6Γ— Microsoft MVP.

Ex VP DevRel & DevTools at RapidAPI Β· Google Developers Advisory Board (gDAB) founding member Β· OpenAPI Business Governing Board, Linux Foundation Β· SF DevNetwork AI/ML Advisory Board Β· Angel investor (Replit, Resend, Daytona, Gumroad and you?).

Award-winning open source engineering leader: 300+ projects, 50–100M downloads a year, including Shades of Purple (5M+ developers) and corona-cli (10B+ queries).

Taught 217K+ developers via NodeCLI.com and VSCode.pro. 160+ talks. Blogging since 2000, billions of views.

❯ Read more about Ahmad Awais or come say hi on 𝕏 @MrAhmadAwais.

Newsletter

The Developer Takeaway

Founder notes on AI, dev tools, and building developer products. No spam.

247,813+ developers subscribed
Comments 4
  • Huzaifah
    Posted on

    Huzaifah Huzaifah

    Reply Author

    Nice. I will definitely be using this. However I have a couple of pointers… Why not throw in Bootstrap media queries to make it compatible at little to no difference? You have 768, why not add 991 and 1200?
    If the user doesn’t use bootstrap, no loss. If they do, it works at an advantage.

    Secondly why stop at 1500? With the introduction of 4K, 5k and now 8k screens, I would definitely have thrown in a few more there for the larger screens. It just makes it future proof.

    Just my thoughts, I’ll be implementing this now. Keep it up.


  • Mujahid Abbas
    Posted on

    Mujahid Abbas Mujahid Abbas

    Reply Author

    Off-topic question,
    Thank You Ahmed Awais for all the guides and tutorials and contribution to WordPress. It is because of your blog that I have taken keen interest in WordPress development. I currently make websites in WordPress using themes. But I want to really get in to the theme and plugin development. Can you please guide me here shortly, how can I start learning that? Where to start from? What should I learn first?
    Thank You


    • Ahmad Awais
      Posted on

      Ahmad Awais Ahmad Awais

      Reply Author

      Well, That’s very kind of you to say! πŸ’―
      All I can say is look into theme and plugin handbooks. Google the links. Or signup at https://AhmadAwais.com/subscribe/ and read the newsletters I send twice a month. I will announce a course quite pretty soon.