Skip to content

Commit 12babce

Browse files
committed
docs: added some further aspects
1 parent c100148 commit 12babce

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![Open Source Love](https://badges.frapsoft.com/os/v3/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badges/)
1010
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](CODE-OF-CONDUCT.md)
1111

12-
A modern JavaScript polyfill and PostCSS plugin for the [CSS `if()` function](https://developer.mozilla.org/en-US/docs/Web/CSS/if) with **hybrid build-time and runtime processing**. Transforms CSS `if()` functions to native `@media` and `@supports` rules where possible, with runtime fallback for dynamic conditions.
12+
A modern JavaScript [polyfill](https://github.com/mfranzke/css-if-polyfill/tree/main/packages/css-if-polyfill) and [PostCSS plugin](https://github.com/mfranzke/css-if-polyfill/tree/main/packages/postcss-if-function) for the [CSS `if()` function](https://developer.mozilla.org/en-US/docs/Web/CSS/if) with **hybrid build-time and runtime processing**. Transforms CSS `if()` functions to native `@media` and `@supports` rules where possible, with runtime fallback for dynamic conditions.
1313

1414
## Contributing
1515

packages/postcss-if-function/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ A [PostCSS](https://postcss.org/) plugin for transforming CSS `if()` functions i
88

99
This plugin is part of the [css-if-polyfill](https://github.com/mfranzke/css-if-polyfill/tree/main/packages/css-if-polyfill/) project and provides build-time transformation of conditional CSS, eliminating the need for runtime JavaScript processing when using only `media()` and `supports()` functions.
1010

11+
<!-- FIXTURE: basic-media -->
12+
13+
<!-- Note: This content is automatically generated from test fixtures. Do not edit the code blocks directly - they will be overwritten during the build process. To modify test cases, edit the corresponding .input.css and .expected.css files in the test/fixtures/ directory -->
14+
15+
**Input CSS:**
16+
17+
```css
18+
.responsive {
19+
width: if(media(max-width: 768px): 100%; else: 50%);
20+
}
21+
```
22+
23+
**Expected Output:**
24+
25+
```css
26+
.responsive {
27+
width: 50%;
28+
}
29+
@media (max-width: 768px) {
30+
.responsive {
31+
width: 100%;
32+
}
33+
}
34+
```
35+
36+
<!-- /FIXTURE -->
37+
1138
## Installation
1239

1340
```bash

0 commit comments

Comments
 (0)