• Stars
    star
    2,571
  • Rank 17,830 (Top 0.4 %)
  • Language SCSS
  • License
    MIT License
  • Created almost 10 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿ“ Simple, elegant and maintainable media queries in Sass

'At' sign

include-media Build Status

Simple, elegant and maintainable media queries in Sass

NPM badge

What?

include-media is a Sass library for writing CSS media queries in an easy and maintainable way, using a natural and simplistic syntax.

2.0 Release

As of 2.0 include-media only supports dart-sass 1.25+

Why?

I spent quite some time experimenting with different libraries and mixins available out there, but eventually all of them failed to do everything I needed in an elegant way. Some of them wouldn't let me mix set breakpoints with case-specific values, others wouldn't properly handle the CSS OR operator and most of them had a syntax that I found complicated and unnatural.

include-media was the result of that experience and it includes all the features I wish I had found before, whilst maintaining a simplistic and natural syntax.

How to install

  • With npm: npm install include-media
  • With yarn: yarn add include-media
  • With Bower: bower install include-media
  • With Rails: gem 'include_media_rails' (maintained by KaoruDev)
  • Manually: get this file

Finally, include the file in your project using an @import statement.

How to use

Examples can be found here.

Plugins

  • include-media-export - Reference include-media breakpoints in JavaScript.
  • include-media-columns - Generate column classes using the BEMIT naming convention, automatically referencing include-media breakpoints.
  • include-media-spread - Calculates the difference between property values and distributes them through your include-media breakpoints.
  • flex_e_ble - Uses your include-media breakpoints to create your own flexible class naming structure on top of a flex based grid with inline-block fallback for IE8+ compatibility.
  • include-media-grid - An include-media plugin for generating grid classes based on the flex display.
  • im-to-em - A tiny function to convert include-media breakpoints from px to em.
  • include-media-hidden-classes - An include-media plugin to generate classes for hiding elements.
  • Fluid-Size: Use include-media breakepoints to provide the fit size for the device.

Learn more

Related projects

  • include-media-or - A fork of include-media with support for complex queries with logical disjunctions (maintained by Nirazul).

The authors

include-media was created by Eduardo Bouรงas and Kitty Giraudel. The lead maintainer is Jack McNicol.

We want to hear from you

We'll be on the lookout for your issues and pull requests โ€” but make sure you read this before submitting any code!

License

This project is licensed under the terms of the MIT license.

More Repositories

1

staticman

๐Ÿ’ช User-generated content for Git-powered websites
JavaScript
2,413
star
2

static-api-generator

๐Ÿ”ง Generate a static JSON API from a tree of directories and files
JavaScript
146
star
3

compat-report

๐Ÿ”Œ A Developer Tools panel for flagging browser compatibility issues
JavaScript
117
star
4

buildtimes

โœ๏ธ Musings on building (and breaking) websites
JavaScript
88
star
5

popcorn

๐ŸŽฌ Demo of a Jekyll site using Staticman
HTML
85
star
6

include-media-export

๐Ÿ“ An include-media plugin for exporting breakpoints from Sass to JavaScript
JavaScript
72
star
7

inquirer-table-prompt

A table-like prompt for Inquirer
JavaScript
37
star
8

hugo-plus-staticman

โšก๏ธ Demo site using Hugo + Staticman
HTML
25
star
9

jekyll-social

Select what social media platforms to share your Jekyll blog posts on, right from the front matter.
21
star
10

jekyll-dynamic-menu

A Liquid snippet to generate markup for a dynamic navigation menu in Jekyll
HTML
19
star
11

postcss-cssential

๐Ÿšฉ PostCSS plugin to identify annotated blocks of critical CSS and inline them into a page
JavaScript
19
star
12

haiku

๐Ÿš€ Instant Heroku deploys from GitHub branches
JavaScript
16
star
13

include-media-columns

An include-media plugin for generating grid classes based on the BEMIT naming convention
CSS
16
star
14

gitemon

๐Ÿ‘พ Gotta Catch 'Em All!
JavaScript
16
star
15

wp-api-post-groups

A WP-API extension that allows multiple groups of posts with different filters to be obtained in a single request
PHP
15
star
16

eleventy-blog-staticman

A starter repository for a blog web site using the Eleventy static site generator and Staticman.
HTML
10
star
17

grunt-sass-import

A Grunt module for importing Sass partials with (some very basic) notion of source order
JavaScript
10
star
18

staticman-recaptcha

๐Ÿ‘ฎโ€โ™‚๏ธ Demo site using Staticman + reCAPTCHA
CSS
10
star
19

movies-api

๐ŸŽž Demo API using static-api-generator
JavaScript
9
star
20

homebridge-toggle-switch

Toggle switch for Homebridge
JavaScript
6
star
21

include-media-hidden-classes

๐Ÿ“ An include-media plugin to generate classes for hiding elements
CSS
6
star
22

notification-bus

๐ŸšŒ A Node.js library for loading and rendering notifications from a remote API
TypeScript
6
star
23

find-types

๐Ÿ” Find which of your module's dependencies have TypeScript types available
JavaScript
6
star
24

scheduled-netlify-deploys

Trigger Netlify deploys on a schedule
TypeScript
5
star
25

new-function

โœจ A tiny utility for creating a new Netlify Function.
JavaScript
4
star
26

staticman.net

๐Ÿ’ช Staticman website
SCSS
4
star
27

js-promise-queue

๐ŸŽข Runs JavaScript Promises in a queue
JavaScript
3
star
28

denis

A friendly DNS management bot for Slack
JavaScript
3
star
29

todo-api

๐Ÿ“‹ A RESTful API for a to-do list application built with DADI API
JavaScript
2
star
30

homebridge-arlo-basestation

Homebridge plugin for integrating Arlo with HomeKit
JavaScript
2
star
31

ok-to-test-action

2
star
32

next-netlify-starter-2

JavaScript
2
star
33

component-tree-webpack-plugin

A Webpack plugin for creating a simple tree of component dependencies
JavaScript
2
star
34

netlifind

Shell
2
star
35

codepen-scraper

JavaScript
1
star
36

next-netlify-starter

JavaScript
1
star
37

node-github-wrapper

JavaScript
1
star
38

mdn-speedtracker

JavaScript
1
star
39

preact-jsx-chai-match-template

๐Ÿ—œ A method that adds assertions with html-looks-like to Chai for testing Preact components
JavaScript
1
star
40

signally-case

1
star
41

jekyll-discuss-php

(UNMAINTAINED) A commenting system for Jekyll
PHP
1
star