Download the PHP package knysakpatryk/media-query-suppressor without Composer

On this page you can find all versions of the php package knysakpatryk/media-query-suppressor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package media-query-suppressor

Media Query Suppressor Latest Stable Version Build Status Coverage Status

This library helps you with "suppressing" media queries in your dynamic content. Why would you do that? You have to do that if your site is responsive (for example based on Bootstrap) and you want to create non-responsive (classic) version of your site (for mobile devices etc.).

Attention

Many people creates media queries in many ways. For example they set them up to fire and achieve classic-like appearance, so the base CSS without media queries will not be full (classic) website, but (e.g.) mobile version. Website design should be coded in another way. Base CSS without media queries should be classic, desktop version and all media queries should apply to fit other devices. Wrongly coded website enforce us to:

  1. rewrite all media queries (this can be painful)
  2. or cleverly choose suppression strategy to overcome this issue (but it's not always possible)

Installation

Edit your project's composer.json file to require knysakpatryk/media-query-suppressor

Usage

Suppression strategies

ReduceStrategy (recommended)

This strategy is upgraded ReplaceStrategy. It sets max-width directives to 1px (because desktop version of site should not have upper width limits) and replaces min-width directives with corresponding replacements starting from 1px. By this, you can overcome the override issue of ReplaceStrategy.

ReplaceStrategy

It sets max-width directives to 1px and min-width directives to 2px. This strategy works in the most simple cases, but can go wrong with complicated ones - because you can accidentally override other media query (which was not intended).

Example use case

Our client has website based on Bootstrap. He wants to add classic version of the site - just by clicking button in the bottom of the page. Classic version should not vary on different devices/screen sizes (non-responsive).

How can we do that?
  1. First, we create another, non-responsive CSS spreadsheet for classic version (this step can be also done by this library).
  2. Next, we use this library to "suppress" any other media queries from dynamic content (for example loaded from database).
  3. Lastly, we add button at the bottom of the page, to switch website version.

In real world scenario, it's not going to be that easy, but this is only a simple use case example.

License

The library is open-sourced software licensed under the MIT license.


All versions of media-query-suppressor with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package knysakpatryk/media-query-suppressor contains the following files

Loading the files please wait ....