PHPackages                             knysakpatryk/media-query-suppressor - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. knysakpatryk/media-query-suppressor

ActiveLibrary[Image &amp; Media](/categories/media)

knysakpatryk/media-query-suppressor
===================================

This library helps you to suppress media queries in your dynamic content

v0.1.1(10y ago)252MITPHPPHP &gt;=5.4

Since May 7Pushed 9y ago2 watchersCompare

[ Source](https://github.com/KnysakPatryk/media-query-suppressor)[ Packagist](https://packagist.org/packages/knysakpatryk/media-query-suppressor)[ RSS](/packages/knysakpatryk-media-query-suppressor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Media Query Suppressor [![Latest Stable Version](https://camo.githubusercontent.com/3c0d565aab8ca43805e57b137837b030c620061ea52f48b40a72d3f94db79096/68747470733a2f2f706f7365722e707567782e6f72672f6b6e7973616b70617472796b2f6d656469612d71756572792d73757070726573736f722f762f737461626c652e706e67)](https://packagist.org/packages/knysakpatryk/media-query-suppressor) [![Build Status](https://camo.githubusercontent.com/25e580db10796016e8ae6aba3bff7c979d6f55b966e106e6ba5a2950baef7134/68747470733a2f2f7472617669732d63692e6f72672f4b6e7973616b50617472796b2f6d656469612d71756572792d73757070726573736f722e706e67)](https://travis-ci.org/KnysakPatryk/media-query-suppressor) [![Coverage Status](https://camo.githubusercontent.com/7c2c177a3f1be718fd8d39975fcdcb6893ff89af925ad96a378d89bb5d407cf2/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4b6e7973616b50617472796b2f6d656469612d71756572792d73757070726573736f722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/KnysakPatryk/media-query-suppressor?branch=master)
==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#media-query-suppressor---)

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
---------

[](#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
------------

[](#installation)

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

```
"require": {
    "knysakpatryk/media-query-suppressor": "0.1.*"
}
```

Usage
-----

[](#usage)

```
$suppressionStrategy = new KnysakPatryk\MediaQuerySuppressor\Strategy\ReduceStrategy();
$mediaQuerySuppressor = new KnysakPatryk\MediaQuerySuppressor\Suppressor($suppressionStrategy);

echo $mediaQuerySuppressor->one('string');
// or
print_r($mediaQuerySuppressor->many(['string 1', 'string 2']));
```

Suppression strategies
----------------------

[](#suppression-strategies)

#### ReduceStrategy *(recommended)*

[](#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

[](#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
----------------

[](#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?

[](#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
-------

[](#license)

The library is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

3656d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8704acf3763023643b1a3358e8c5932f9632edf76a0477ea75fd1b5a298a261b?d=identicon)[KnysakPatryk](/maintainers/KnysakPatryk)

---

Top Contributors

[![KnysakPatryk](https://avatars.githubusercontent.com/u/4018931?v=4)](https://github.com/KnysakPatryk "KnysakPatryk (42 commits)")

---

Tags

cssquerymediabootstraprwdmedia-query-suppressormedia-query

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/knysakpatryk-media-query-suppressor/health.svg)

```
[![Health](https://phpackages.com/badges/knysakpatryk-media-query-suppressor/health.svg)](https://phpackages.com/packages/knysakpatryk-media-query-suppressor)
```

###  Alternatives

[essence/essence

Extracts information about medias on the web, like youtube videos, twitter statuses or blog articles.

770562.9k3](/packages/essence-essence)[s9e/text-formatter

Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding third-party media (YouTube, etc...), enhanced typography and more.

2413.1M29](/packages/s9e-text-formatter)[talvbansal/media-manager

A media browser and uploader for laravel apps written in vue js and bootstrap

20827.7k4](/packages/talvbansal-media-manager)[dereuromark/media-embed

A PHP library to deal with all those media services around, parsing their URLs and embedding their audio/video content in websites.

182530.3k11](/packages/dereuromark-media-embed)[cohensive/embed

Media Embed (for Laravel or as a standalone).

120370.4k](/packages/cohensive-embed)[classic-o/nova-media-library

Tool and field that will let you managing files and add them to the posts

154172.0k](/packages/classic-o-nova-media-library)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
