Full Code of parcel-bundler/lightningcss for AI

master df63db2c51c4 cached
219 files
3.6 MB
948.1k tokens
3700 symbols
1 requests
Download .txt
Showing preview only (3,789K chars total). Download the full file or copy to clipboard to get everything.
Repository: parcel-bundler/lightningcss
Branch: master
Commit: df63db2c51c4
Files: 219
Total size: 3.6 MB

Directory structure:
gitextract_yxy6uf4y/

├── .cargo/
│   └── config.toml
├── .github/
│   └── workflows/
│       ├── release-crates.yml
│       ├── release.yml
│       └── test.yml
├── .gitignore
├── .prettierrc
├── CONTRIBUTING.md
├── Cargo.toml
├── LICENSE
├── README.md
├── bench.js
├── c/
│   ├── Cargo.toml
│   ├── build.rs
│   ├── cbindgen.toml
│   ├── lightningcss.h
│   ├── src/
│   │   └── lib.rs
│   └── test.c
├── cli/
│   ├── .gitignore
│   ├── lightningcss
│   └── postinstall.js
├── derive/
│   ├── Cargo.toml
│   └── src/
│       ├── lib.rs
│       ├── parse.rs
│       ├── to_css.rs
│       └── visit.rs
├── examples/
│   ├── custom_at_rule.rs
│   ├── schema.rs
│   └── serialize.rs
├── napi/
│   ├── Cargo.toml
│   └── src/
│       ├── at_rule_parser.rs
│       ├── lib.rs
│       ├── threadsafe_function.rs
│       ├── transformer.rs
│       └── utils.rs
├── node/
│   ├── Cargo.toml
│   ├── ast.d.ts
│   ├── browserslistToTargets.js
│   ├── build.rs
│   ├── composeVisitors.js
│   ├── flags.js
│   ├── index.d.ts
│   ├── index.js
│   ├── index.mjs
│   ├── src/
│   │   └── lib.rs
│   ├── targets.d.ts
│   ├── test/
│   │   ├── bundle.test.mjs
│   │   ├── composeVisitors.test.mjs
│   │   ├── customAtRules.mjs
│   │   ├── transform.test.mjs
│   │   └── visitor.test.mjs
│   └── tsconfig.json
├── package.json
├── patches/
│   ├── @babel+types+7.26.3.patch
│   └── json-schema-to-typescript+11.0.5.patch
├── rust-toolchain.toml
├── rustfmt.toml
├── scripts/
│   ├── build-ast.js
│   ├── build-flow.js
│   ├── build-npm.js
│   ├── build-prefixes.js
│   ├── build-wasm.js
│   └── build.js
├── selectors/
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── attr.rs
│   ├── bloom.rs
│   ├── build.rs
│   ├── builder.rs
│   ├── context.rs
│   ├── lib.rs
│   ├── matching.rs
│   ├── nth_index_cache.rs
│   ├── parser.rs
│   ├── serialization.rs
│   ├── sink.rs
│   ├── tree.rs
│   └── visitor.rs
├── src/
│   ├── bundler.rs
│   ├── compat.rs
│   ├── context.rs
│   ├── css_modules.rs
│   ├── declaration.rs
│   ├── dependencies.rs
│   ├── error.rs
│   ├── lib.rs
│   ├── logical.rs
│   ├── macros.rs
│   ├── main.rs
│   ├── media_query.rs
│   ├── parser.rs
│   ├── prefixes.rs
│   ├── printer.rs
│   ├── properties/
│   │   ├── align.rs
│   │   ├── animation.rs
│   │   ├── background.rs
│   │   ├── border.rs
│   │   ├── border_image.rs
│   │   ├── border_radius.rs
│   │   ├── box_shadow.rs
│   │   ├── contain.rs
│   │   ├── css_modules.rs
│   │   ├── custom.rs
│   │   ├── display.rs
│   │   ├── effects.rs
│   │   ├── flex.rs
│   │   ├── font.rs
│   │   ├── grid.rs
│   │   ├── list.rs
│   │   ├── margin_padding.rs
│   │   ├── masking.rs
│   │   ├── mod.rs
│   │   ├── outline.rs
│   │   ├── overflow.rs
│   │   ├── position.rs
│   │   ├── prefix_handler.rs
│   │   ├── size.rs
│   │   ├── svg.rs
│   │   ├── text.rs
│   │   ├── transform.rs
│   │   ├── transition.rs
│   │   └── ui.rs
│   ├── rules/
│   │   ├── container.rs
│   │   ├── counter_style.rs
│   │   ├── custom_media.rs
│   │   ├── document.rs
│   │   ├── font_face.rs
│   │   ├── font_feature_values.rs
│   │   ├── font_palette_values.rs
│   │   ├── import.rs
│   │   ├── keyframes.rs
│   │   ├── layer.rs
│   │   ├── media.rs
│   │   ├── mod.rs
│   │   ├── namespace.rs
│   │   ├── nesting.rs
│   │   ├── page.rs
│   │   ├── property.rs
│   │   ├── scope.rs
│   │   ├── starting_style.rs
│   │   ├── style.rs
│   │   ├── supports.rs
│   │   ├── unknown.rs
│   │   ├── view_transition.rs
│   │   └── viewport.rs
│   ├── selector.rs
│   ├── serialization.rs
│   ├── stylesheet.rs
│   ├── targets.rs
│   ├── test_helpers.rs
│   ├── traits.rs
│   ├── values/
│   │   ├── alpha.rs
│   │   ├── angle.rs
│   │   ├── calc.rs
│   │   ├── color.rs
│   │   ├── easing.rs
│   │   ├── gradient.rs
│   │   ├── ident.rs
│   │   ├── image.rs
│   │   ├── length.rs
│   │   ├── mod.rs
│   │   ├── number.rs
│   │   ├── percentage.rs
│   │   ├── position.rs
│   │   ├── ratio.rs
│   │   ├── rect.rs
│   │   ├── resolution.rs
│   │   ├── shape.rs
│   │   ├── size.rs
│   │   ├── string.rs
│   │   ├── syntax.rs
│   │   ├── time.rs
│   │   └── url.rs
│   ├── vendor_prefix.rs
│   └── visitor.rs
├── static-self/
│   ├── Cargo.toml
│   └── src/
│       └── lib.rs
├── static-self-derive/
│   ├── Cargo.toml
│   └── src/
│       ├── into_owned.rs
│       └── lib.rs
├── test-integration.mjs
├── test.js
├── tests/
│   ├── cli_integration_tests.rs
│   ├── test_cssom.rs
│   ├── test_custom_parser.rs
│   ├── test_serde.rs
│   └── testdata/
│       ├── a.css
│       ├── apply.css
│       ├── b.css
│       ├── baz.css
│       ├── foo.css
│       ├── has_external.css
│       ├── hello/
│       │   └── world.css
│       └── mixin.css
├── wasm/
│   ├── .gitignore
│   ├── async.mjs
│   ├── import.meta.url-polyfill.js
│   ├── index.mjs
│   └── wasm-node.mjs
└── website/
    ├── .posthtmlrc
    ├── bundling.html
    ├── css-modules.html
    ├── docs.css
    ├── docs.html
    ├── docs.js
    ├── include/
    │   └── layout.html
    ├── index.html
    ├── minification.html
    ├── pages/
    │   ├── bundling.md
    │   ├── css-modules.md
    │   ├── docs.md
    │   ├── minification.md
    │   ├── transforms.md
    │   └── transpilation.md
    ├── playground/
    │   ├── index.html
    │   └── playground.js
    ├── synthwave.css
    ├── transforms.html
    └── transpilation.html

================================================
FILE CONTENTS
================================================

================================================
FILE: .cargo/config.toml
================================================
[target.'cfg(target_env = "gnu")']
rustflags = ["-C", "link-args=-Wl,-z,nodelete"]

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]

[target.wasm32-unknown-unknown]
rustflags = [
    "-C",
    "link-arg=--export-table",
    '--cfg',
    'getrandom_backend="custom"',
]


# Statically link Visual Studio redistributables on Windows builds
[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
[target.aarch64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]


================================================
FILE: .github/workflows/release-crates.yml
================================================
name: release-crates
on:
  workflow_dispatch:

jobs:
  release-crates:
    runs-on: ubuntu-latest
    name: Release Rust crate
    steps:
      - uses: actions/checkout@v3
      - uses: bahmutov/npm-install@v1.8.32
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      - run: cargo login ${CRATES_IO_TOKEN}
        env:
          CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
      - run: |
          cargo install cargo-workspaces
          cargo workspaces publish --no-remove-dev-deps --from-git -y


================================================
FILE: .github/workflows/release.yml
================================================
name: release
on:
  workflow_dispatch:

jobs:
  build:
    strategy:
      fail-fast: false
      matrix:
        include:
          # Windows
          - os: windows-latest
            target: x86_64-pc-windows-msvc
            binary: lightningcss.exe
          - os: windows-latest
            target: aarch64-pc-windows-msvc
            binary: lightningcss.exe
          # Mac OS
          - os: macos-latest
            target: x86_64-apple-darwin
            strip: strip -x # Must use -x on macOS. This produces larger results on linux.
            binary: lightningcss

    name: build-${{ matrix.target }}
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v3
      - name: Install Node.JS
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Setup rust target
        run: rustup target add ${{ matrix.target }}

      - uses: bahmutov/npm-install@v1.8.32
      - name: Build release
        run: yarn build-release
        env:
          RUST_TARGET: ${{ matrix.target }}
      - name: Build CLI
        run: |
          cargo build --release --features cli --target ${{ matrix.target }}
          node -e "require('fs').renameSync('target/${{ matrix.target }}/release/${{ matrix.binary }}', '${{ matrix.binary }}')"
      - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
        if: ${{ matrix.strip }}
        run: ${{ matrix.strip }} *.node ${{ matrix.binary }}
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: bindings-${{ matrix.target }}
          path: |
            *.node
            ${{ matrix.binary }}

  build-apple-silicon:
    name: build-apple-silicon
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Node.JS
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Setup rust target
        run: rustup target add aarch64-apple-darwin

      - uses: bahmutov/npm-install@v1.8.32
      - name: Build release
        run: yarn build-release
        env:
          RUST_TARGET: aarch64-apple-darwin
          JEMALLOC_SYS_WITH_LG_PAGE: 14
      - name: Build CLI
        run: |
          export CC=$(xcrun -f clang);
          export CXX=$(xcrun -f clang++);
          SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
          export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
          export MACOSX_DEPLOYMENT_TARGET="10.9";
          cargo build --release --features cli --target aarch64-apple-darwin
          mv target/aarch64-apple-darwin/release/lightningcss lightningcss
        env:
          JEMALLOC_SYS_WITH_LG_PAGE: 14
      - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
        run: strip -x *.node lightningcss
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: bindings-aarch64-apple-darwin
          path: |
            *.node
            lightningcss

  build-linux:
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            strip: strip
            image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
            setup: npm install --global yarn@1
          - target: aarch64-unknown-linux-gnu
            strip: llvm-strip
            image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
          - target: aarch64-linux-android
            strip: llvm-strip
            image: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
          - target: armv7-unknown-linux-gnueabihf
            strip: llvm-strip
            image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:c22284b2d79092d3e885f64ede00f6afdeb2ccef7e2b6e78be52e7909091cd57
          - target: aarch64-unknown-linux-musl
            image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:78c9ab1f117f8c535b93c4b91a2f19063dda6e4dba48a6187df49810625992c1
            strip: aarch64-linux-musl-strip
          - target: x86_64-unknown-linux-musl
            image: ghcr.io/napi-rs/napi-rs/nodejs-rust@sha256:78c9ab1f117f8c535b93c4b91a2f19063dda6e4dba48a6187df49810625992c1
            strip: strip

    name: build-${{ matrix.target }}
    runs-on: ubuntu-latest
    container:
      image: ${{ matrix.image }}

    steps:
      - uses: actions/checkout@v3
      - name: Install Node.JS
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Setup Android NDK
        if: ${{ matrix.target == 'aarch64-linux-android' }}
        run: |
          sudo apt update && sudo apt install unzip -y
          cd /tmp
          wget -q https://dl.google.com/android/repository/android-ndk-r28-linux.zip -O /tmp/ndk.zip
          unzip ndk.zip

      - name: Setup cross compile toolchain
        if: ${{ matrix.setup }}
        run: ${{ matrix.setup }}

      - name: Setup rust target
        run: rustup target add ${{ matrix.target }}

      - uses: bahmutov/npm-install@v1.8.32
      - name: Build release
        run: yarn build-release
        env:
          ANDROID_NDK_LATEST_HOME: /tmp/android-ndk-r28
          RUST_TARGET: ${{ matrix.target }}
      - name: Build CLI
        env:
          ANDROID_NDK_LATEST_HOME: /tmp/android-ndk-r28
        run: |
          yarn napi build --bin lightningcss --release --features cli --target ${{ matrix.target }}
          mv target/${{ matrix.target }}/release/lightningcss lightningcss
      - name: Strip debug symbols # https://github.com/rust-lang/rust/issues/46034
        if: ${{ matrix.strip }}
        run: ${{ matrix.strip }} *.node lightningcss
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: bindings-${{ matrix.target }}
          path: |
            *.node
            lightningcss

  build-freebsd:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Build FreeBSD
        uses: cross-platform-actions/action@v0.25.0
        env:
          DEBUG: napi:*
          RUSTUP_HOME: /usr/local/rustup
          CARGO_HOME: /usr/local/cargo
          RUSTUP_IO_THREADS: 1
        with:
          operating_system: freebsd
          version: '14.0'
          memory: 13G
          cpu_count: 3
          environment_variables: 'DEBUG RUSTUP_IO_THREADS'
          shell: bash
          run: |
            sudo pkg install -y -f curl node libnghttp2 npm yarn
            curl https://sh.rustup.rs -sSf --output rustup.sh
            sh rustup.sh -y --profile minimal --default-toolchain beta
            source "$HOME/.cargo/env"
            echo "~~~~ rustc --version ~~~~"
            rustc --version
            echo "~~~~ node -v ~~~~"
            node -v
            echo "~~~~ yarn --version ~~~~"
            yarn --version
            yarn install || true
            yarn build-release
            strip -x *.node
            cargo build --release --features cli
            mv target/release/lightningcss lightningcss
            node -e "require('.')"
            ./lightningcss --help
            rm -rf node_modules
            rm -rf target
            rm -rf .yarn/cache

      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: bindings-x86_64-unknown-freebsd
          path: |
            *.node
            lightningcss

  build-wasm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install Node.JS
        uses: actions/setup-node@v3
        with:
          node-version: 18
      - uses: bahmutov/npm-install@v1.8.32
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-unknown-unknown
      - name: Setup rust target
        run: rustup target add wasm32-unknown-unknown
      - name: Install wasm-opt
        run: |
          curl -L -O https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-linux.tar.gz
          tar -xf binaryen-version_111-x86_64-linux.tar.gz
      - name: Build wasm
        run: |
          export PATH="$PATH:./binaryen-version_111/bin"
          yarn wasm:build-release
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: wasm
          path: wasm/lightningcss_node.wasm

  release:
    runs-on: ubuntu-latest
    name: Build and release
    needs:
      - build
      - build-linux
      - build-apple-silicon
      - build-freebsd
      - build-wasm
    steps:
      - uses: actions/checkout@v3
      - uses: bahmutov/npm-install@v1.8.32
      - name: Download artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts
      - name: Show artifacts
        run: ls -R artifacts
      - name: Build npm packages
        run: |
          node scripts/build-npm.js
          cp artifacts/wasm/* wasm/.
          node scripts/build-wasm.js
      - run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > ~/.npmrc
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
      - name: Publish to npm
        run: |
          for pkg in npm/*; do
            echo "Publishing $pkg..."
            cd $pkg;
            npm publish;
            cd ../..;
          done
          cd wasm
          echo "Publishing lightningcss-wasm...";
          npm publish
          cd ..
          cd cli
          echo "Publishing lightningcss-cli...";
          npm publish
          cd ..
          echo "Publishing lightningcss...";
          npm publish

  release-crates:
    runs-on: ubuntu-latest
    name: Release Rust crate
    steps:
      - uses: actions/checkout@v3
      - uses: bahmutov/npm-install@v1.8.32
      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
      - run: cargo login ${CRATES_IO_TOKEN}
        env:
          CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
      - run: |
          cargo install cargo-workspaces
          cargo workspaces publish --no-remove-dev-deps --from-git -y


================================================
FILE: .github/workflows/test.yml
================================================
name: test

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest
    env:
      CARGO_TERM_COLOR: always
      RUST_BACKTRACE: full
      RUSTFLAGS: -D warnings
    steps:
      - uses: actions/checkout@v3
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo fmt
      - run: cargo test --all-features

  test-js:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - uses: bahmutov/npm-install@v1.8.32
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: yarn build
      - run: yarn test
      - run: yarn tsc

  test-wasm:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 18
      - uses: bahmutov/npm-install@v1.8.32
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: wasm32-unknown-unknown
      - name: Setup rust target
        run: rustup target add wasm32-unknown-unknown
      - uses: Swatinem/rust-cache@v2
      - name: Install wasm-opt
        run: |
          curl -L -O https://github.com/WebAssembly/binaryen/releases/download/version_111/binaryen-version_111-x86_64-linux.tar.gz
          tar -xf binaryen-version_111-x86_64-linux.tar.gz
      - name: Build wasm
        run: |
          export PATH="$PATH:./binaryen-version_111/bin"
          yarn wasm:build-release
      - run: TEST_WASM=node yarn test
      - run: TEST_WASM=browser yarn test


================================================
FILE: .gitignore
================================================
.DS_Store
*.node
node_modules/
target/
pkg/
dist/
.parcel-cache
node/*.flow
artifacts
npm
node/ast.json


================================================
FILE: .prettierrc
================================================
{
  "bracketSpacing": false,
  "endOfLine": "lf",
  "singleQuote": true,
  "trailingComma": "all"
}


================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

Welcome, we really appreciate if you're considering to contribute, the joint effort of our contributors make projects like this possible!

The goal of this document is to provide guidance on how you can get involved.

## Getting started with bug fixing

In order to make it easier to get familiar with the codebase we labeled simpler issues using [Good First Issue](https://github.com/parcel-bundler/lightningcss/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) and [Help Wanted](https://github.com/parcel-bundler/lightningcss/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22help+wanted%22).

Before starting make sure you have the following requirements installed: [git](https://git-scm.com), [Node](https://nodejs.org), [Yarn](https://yarnpkg.com) and [Rust](https://www.rust-lang.org/tools/install).

The process starts by [forking](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) the project and setup a new branch to work in. It's important that the changes are made in separated branches in order to ensure a pull request only includes the commits related to a bug or feature.

Clone the forked repository locally and install the dependencies:

```sh
git clone https://github.com/USERNAME/lightningcss.git
cd lightningcss
yarn install
```

## Testing

In order to test, you first need to build the core package:

```sh
yarn build
```

Then you can run the tests:

```sh
yarn test # js tests
cargo test # rust tests
```

## Building

There are different build targets available, with "release" being a production build:

```sh
yarn build
yarn build-release

yarn wasm:build
yarn wasm:build-release
```

Note: If you plan to build the WASM target, ensure that you have the required toolchain and binaries installed.

```sh
rustup target add wasm32-unknown-unknown
cargo install wasm-opt
```

## Website

The website is built using [Parcel](https://parceljs.org). You can start the development server by running:

```sh
yarn website:start
```


================================================
FILE: Cargo.toml
================================================
[workspace]
members = [
  "node",
  "napi",
  "selectors",
  "c",
  "derive",
  "static-self",
  "static-self-derive",
]

[package]
authors = ["Devon Govett <devongovett@gmail.com>"]
name = "lightningcss"
version = "1.0.0-alpha.71"
description = "A CSS parser, transformer, and minifier"
license = "MPL-2.0"
edition = "2021"
keywords = ["CSS", "minifier", "Parcel"]
repository = "https://github.com/parcel-bundler/lightningcss"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[[bin]]
name = "lightningcss"
path = "src/main.rs"
required-features = ["cli"]

[lib]
name = "lightningcss"
path = "src/lib.rs"
crate-type = ["rlib"]

[features]
default = ["bundler", "nodejs", "sourcemap"]
browserslist = ["browserslist-rs"]
bundler = ["dashmap", "sourcemap", "rayon"]
cli = ["atty", "clap", "serde_json", "browserslist", "jemallocator"]
jsonschema = ["schemars", "serde", "parcel_selectors/jsonschema"]
nodejs = ["dep:serde", "dep:serde-content"]
serde = [
  "dep:serde",
  "dep:serde-content",
  "bitflags/serde",
  "smallvec/serde",
  "cssparser/serde",
  "parcel_selectors/serde",
  "into_owned",
]
sourcemap = ["parcel_sourcemap"]
visitor = []
into_owned = [
  "static-self",
  "static-self/smallvec",
  "static-self/indexmap",
  "parcel_selectors/into_owned",
]
substitute_variables = ["visitor", "into_owned"]

[dependencies]
serde = { version = "1.0.228", features = ["derive"], optional = true }
serde-content = { version = "0.1.2", features = ["serde"], optional = true }
cssparser = "0.33.0"
cssparser-color = "0.1.0"
parcel_selectors = { version = "0.28.2", path = "./selectors" }
itertools = "0.10.1"
smallvec = { version = "1.7.0", features = ["union"] }
bitflags = "2.2.1"
parcel_sourcemap = { version = "2.1.1", features = ["json"], optional = true }
data-encoding = "2.3.2"
lazy_static = "1.4.0"
const-str = "0.3.1"
pathdiff = "0.2.1"
ahash = "0.8.7"
pastey = "0.1.0"
indexmap = { version = "2.2.6", features = ["serde"] }
# CLI deps
atty = { version = "0.2", optional = true }
clap = { version = "3.0.6", features = ["derive"], optional = true }
browserslist-rs = { version = "0.19.0", optional = true }
rayon = { version = "1.5.1", optional = true }
dashmap = { version = "5.0.0", optional = true }
serde_json = { version = "1.0.78", optional = true }
lightningcss-derive = { version = "=1.0.0-alpha.43", path = "./derive" }
schemars = { version = "0.8.19", features = ["smallvec", "indexmap2"], optional = true }
static-self = { version = "0.1.2", path = "static-self", optional = true }

[target.'cfg(target_os = "macos")'.dependencies]
jemallocator = { version = "0.3.2", features = [
  "disable_initial_exec_tls",
], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom = { version = "0.3", default-features = false }

[dev-dependencies]
indoc = "1.0.3"
assert_cmd = "2.0"
assert_fs = "1.0"
predicates = "2.1"
serde_json = "1"
pretty_assertions = "1.4.0"

[[test]]
name = "cli_integration_tests"
path = "tests/cli_integration_tests.rs"
required-features = ["cli"]

[[example]]
name = "custom_at_rule"
required-features = ["visitor"]

[[example]]
name = "serialize"
required-features = ["serde"]

[profile.release]
lto = true
codegen-units = 1
panic = 'abort'


================================================
FILE: LICENSE
================================================
 Mozilla Public License Version 2.0
==================================

1. Definitions
--------------

1.1. "Contributor"
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software.

1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used
by a Contributor and that particular Contributor's Contribution.

1.3. "Contribution"
means Covered Software of a particular Contributor.

1.4. "Covered Software"
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code
Form, and Modifications of such Source Code Form, in each case
including portions thereof.

1.5. "Incompatible With Secondary Licenses"
means

(a) that the initial Contributor has attached the notice described
in Exhibit B to the Covered Software; or

(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.

1.6. "Executable Form"
means any form of the work other than Source Code Form.

1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.

1.8. "License"
means this document.

1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.

1.10. "Modifications"
means any of the following:

(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or

(b) any new file in Source Code Form that contains any Covered
Software.

1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.

1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.

1.13. "Source Code Form"
means the form of the work preferred for making modifications.

1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.

2. License Grants and Conditions
--------------------------------

2.1. Grants

Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:

(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and

(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.

2.2. Effective Date

The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.

2.3. Limitations on Grant Scope

The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:

(a) for any code that a Contributor has removed from Covered Software;
or

(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or

(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.

This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).

2.4. Subsequent Licenses

No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).

2.5. Representation

Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.

2.6. Fair Use

This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.

2.7. Conditions

Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.

3. Responsibilities
-------------------

3.1. Distribution of Source Form

All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.

3.2. Distribution of Executable Form

If You distribute Covered Software in Executable Form then:

(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and

(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.

3.3. Distribution of a Larger Work

You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).

3.4. Notices

You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.

3.5. Application of Additional Terms

You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.

4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------

If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.

5. Termination
--------------

5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.

5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.

5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.

************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************

************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************

8. Litigation
-------------

Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.

9. Miscellaneous
----------------

This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.

10. Versions of the License
---------------------------

10.1. New Versions

Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.

10.2. Effect of New Versions

You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.

10.3. Modified Versions

If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).

10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses

If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.

Exhibit A - Source Code Form License Notice
-------------------------------------------

This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.

If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.

You may add additional accurate notices of copyright ownership.

Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------

This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.


================================================
FILE: README.md
================================================
# ⚡️ Lightning CSS

An extremely fast CSS parser, transformer, and minifier written in Rust. Use it with [Parcel](https://parceljs.org), as a standalone library or CLI, or via a plugin with any other tool.

<img width="680" alt="performance and build size charts" src="https://user-images.githubusercontent.com/19409/189022599-28246659-f94a-46a4-9de0-b6d17adb0e22.png#gh-light-mode-only">
<img width="680" alt="performance and build size charts" src="https://user-images.githubusercontent.com/19409/189022693-6956b044-422b-4f56-9628-d59c6f791095.png#gh-dark-mode-only">

## Features

- **Extremely fast** – Parsing and minifying large files is completed in milliseconds, often with significantly smaller output than other tools. See [benchmarks](#benchmarks) below.
- **Typed property values** – many other CSS parsers treat property values as an untyped series of tokens. This means that each transformer that wants to do something with these values must interpret them itself, leading to duplicate work and inconsistencies. Lightning CSS parses all values using the grammar from the CSS specification, and exposes a specific value type for each property.
- **Browser-grade parser** – Lightning CSS is built on the [cssparser](https://github.com/servo/rust-cssparser) and [selectors](https://github.com/servo/stylo/tree/main/selectors) crates created by Mozilla and used by Firefox and Servo. These provide a solid general purpose CSS-parsing foundation on top of which Lightning CSS implements support for all specific CSS rules and properties.
- **Minification** – One of the main purposes of Lightning CSS is to minify CSS to make it smaller. This includes many optimizations including:
  - Combining longhand properties into shorthands where possible.
  - Merging adjacent rules with the same selectors or declarations when it is safe to do so.
  - Combining CSS transforms into a single matrix or vice versa when smaller.
  - Removing vendor prefixes that are not needed, based on the provided browser targets.
  - Reducing `calc()` expressions where possible.
  - Converting colors to shorter hex notation where possible.
  - Minifying gradients.
  - Minifying CSS grid templates.
  - Normalizing property value order.
  - Removing default property sub-values which will be inferred by browsers.
  - Many micro-optimizations, e.g. converting to shorter units, removing unnecessary quotation marks, etc.
- **Vendor prefixing** – Lightning CSS accepts a list of browser targets, and automatically adds (and removes) vendor prefixes.
- **Browserslist configuration** – Lightning CSS supports opt-in browserslist configuration discovery to resolve browser targets and integrate with your existing tools and config setup.
- **Syntax lowering** – Lightning CSS parses modern CSS syntax, and generates more compatible output where needed, based on browser targets.
  - CSS Nesting
  - Custom media queries (draft spec)
  - Logical properties
  * [Color Level 5](https://drafts.csswg.org/css-color-5/)
    - `color-mix()` function
    - Relative color syntax, e.g. `lab(from purple calc(l * .8) a b)`
  - [Color Level 4](https://drafts.csswg.org/css-color-4/)
    - `lab()`, `lch()`, `oklab()`, and `oklch()` colors
    - `color()` function supporting predefined color spaces such as `display-p3` and `xyz`
    - Space separated components in `rgb` and `hsl` functions
    - Hex with alpha syntax
    - `hwb()` color syntax
    - Percent syntax for opacity
    - `#rgba` and `#rrggbbaa` hex colors
  - Selectors
    - `:not` with multiple arguments
    - `:lang` with multiple arguments
    - `:dir`
    - `:is`
  - Double position gradient stops (e.g. `red 40% 80%`)
  - `clamp()`, `round()`, `rem()`, and `mod()` math functions
  - Alignment shorthands (e.g. `place-items`)
  - Two-value `overflow` shorthand
  - Media query range syntax (e.g. `@media (width <= 100px)` or `@media (100px < width < 500px)`)
  - Multi-value `display` property (e.g. `inline flex`)
  - `system-ui` font family fallbacks
- **CSS modules** – Lightning CSS supports compiling a subset of [CSS modules](https://github.com/css-modules/css-modules) features.
  - Locally scoped class and id selectors
  - Locally scoped custom identifiers, e.g. `@keyframes` names, grid lines/areas, `@counter-style` names, etc.
  - Opt-in support for locally scoped CSS variables and other dashed identifiers.
  - `:local()` and `:global()` selectors
  - The `composes` property
- **Custom transforms** – The Lightning CSS visitor API can be used to implement custom transform plugins.

## Documentation

Lightning CSS can be used from [Parcel](https://parceljs.org), as a standalone library from JavaScript or Rust, using a standalone CLI, or wrapped as a plugin within any other tool. See the [Lightning CSS website](https://lightningcss.dev/docs.html) for documentation.

## Benchmarks

<img width="680" alt="performance and build size charts" src="https://user-images.githubusercontent.com/19409/189022599-28246659-f94a-46a4-9de0-b6d17adb0e22.png#gh-light-mode-only">
<img width="680" alt="performance and build size charts" src="https://user-images.githubusercontent.com/19409/189022693-6956b044-422b-4f56-9628-d59c6f791095.png#gh-dark-mode-only">

```
$ node bench.js bootstrap-4.css
cssnano: 544.809ms
159636 bytes

esbuild: 17.199ms
160332 bytes

lightningcss: 4.16ms
143091 bytes


$ node bench.js animate.css
cssnano: 283.105ms
71723 bytes

esbuild: 11.858ms
72183 bytes

lightningcss: 1.973ms
23666 bytes


$ node bench.js tailwind.css
cssnano: 2.198s
1925626 bytes

esbuild: 107.668ms
1961642 bytes

lightningcss: 43.368ms
1824130 bytes
```

For more benchmarks comparing more tools and input, see [here](http://goalsmashers.github.io/css-minification-benchmark/). Note that some of the tools shown perform unsafe optimizations that may change the behavior of the original CSS in favor of smaller file size. Lightning CSS does not do this – the output CSS should always behave identically to the input. Keep this in mind when comparing file sizes between tools.


================================================
FILE: bench.js
================================================
const css = require('./');
const cssnano = require('cssnano');
const postcss = require('postcss');
const esbuild = require('esbuild');

let opts = {
  filename: process.argv[process.argv.length - 1],
  code: require('fs').readFileSync(process.argv[process.argv.length - 1]),
  minify: true,
  // source_map: true,
  targets: {
    chrome: 95 << 16
  }
};

async function run() {
  await doCssNano();

  console.time('esbuild');
  let r = await esbuild.transform(opts.code.toString(), {
    sourcefile: opts.filename,
    loader: 'css',
    minify: true
  });
  console.timeEnd('esbuild');
  console.log(r.code.length + ' bytes');
  console.log('');

  console.time('lightningcss');
  let res = css.transform(opts);
  console.timeEnd('lightningcss');
  console.log(res.code.length + ' bytes');
}

async function doCssNano() {
  console.time('cssnano');
  const result = await postcss([
    cssnano,
  ]).process(opts.code, {from: opts.filename});
  console.timeEnd('cssnano');
  console.log(result.css.length + ' bytes');
  console.log('');
}

run();


================================================
FILE: c/Cargo.toml
================================================
[package]
authors = ["Devon Govett <devongovett@gmail.com>"]
name = "lightningcss_c_bindings"
version = "0.1.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]

[dependencies]
lightningcss = { path = "../", features = ["browserslist"] }
parcel_sourcemap = { version = "2.1.1", features = ["json"] }
browserslist-rs = { version = "0.19.0" }

[build-dependencies]
cbindgen = "0.24.3"


================================================
FILE: c/build.rs
================================================
use std::env;

fn main() {
  let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap();

  cbindgen::generate(crate_dir)
    .expect("Unable to generate bindings")
    .write_to_file("lightningcss.h");
}


================================================
FILE: c/cbindgen.toml
================================================
language = "C"

[parse]
parse_deps = false
include = ["lightningcss"]

[export.rename]
StyleSheetWrapper = "StyleSheet"

[enum]
prefix_with_name = true


================================================
FILE: c/lightningcss.h
================================================
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct CssError CssError;

typedef struct StyleSheet StyleSheet;

typedef struct Targets {
  uint32_t android;
  uint32_t chrome;
  uint32_t edge;
  uint32_t firefox;
  uint32_t ie;
  uint32_t ios_saf;
  uint32_t opera;
  uint32_t safari;
  uint32_t samsung;
} Targets;

typedef struct ParseOptions {
  const char *filename;
  bool nesting;
  bool custom_media;
  bool css_modules;
  const char *css_modules_pattern;
  bool css_modules_dashed_idents;
  bool error_recovery;
} ParseOptions;

typedef struct TransformOptions {
  struct Targets targets;
  char **unused_symbols;
  uintptr_t unused_symbols_len;
} TransformOptions;

typedef struct RawString {
  char *text;
  uintptr_t len;
} RawString;

typedef enum CssModuleReference_Tag {
  /**
   * A local reference.
   */
  CssModuleReference_Local,
  /**
   * A global reference.
   */
  CssModuleReference_Global,
  /**
   * A reference to an export in a different file.
   */
  CssModuleReference_Dependency,
} CssModuleReference_Tag;

typedef struct CssModuleReference_Local_Body {
  /**
   * The local (compiled) name for the reference.
   */
  struct RawString name;
} CssModuleReference_Local_Body;

typedef struct CssModuleReference_Global_Body {
  /**
   * The referenced global name.
   */
  struct RawString name;
} CssModuleReference_Global_Body;

typedef struct CssModuleReference_Dependency_Body {
  /**
   * The name to reference within the dependency.
   */
  struct RawString name;
  /**
   * The dependency specifier for the referenced file.
   */
  struct RawString specifier;
} CssModuleReference_Dependency_Body;

typedef struct CssModuleReference {
  CssModuleReference_Tag tag;
  union {
    CssModuleReference_Local_Body local;
    CssModuleReference_Global_Body global;
    CssModuleReference_Dependency_Body dependency;
  };
} CssModuleReference;

typedef struct CssModuleExport {
  struct RawString exported;
  struct RawString local;
  bool is_referenced;
  struct CssModuleReference *composes;
  uintptr_t composes_len;
} CssModuleExport;

typedef struct CssModulePlaceholder {
  struct RawString placeholder;
  struct CssModuleReference reference;
} CssModulePlaceholder;

typedef struct ToCssResult {
  struct RawString code;
  struct RawString map;
  struct CssModuleExport *exports;
  uintptr_t exports_len;
  struct CssModulePlaceholder *references;
  uintptr_t references_len;
} ToCssResult;

typedef struct PseudoClasses {
  const char *hover;
  const char *active;
  const char *focus;
  const char *focus_visible;
  const char *focus_within;
} PseudoClasses;

typedef struct ToCssOptions {
  bool minify;
  bool source_map;
  const char *input_source_map;
  uintptr_t input_source_map_len;
  const char *project_root;
  struct Targets targets;
  bool analyze_dependencies;
  struct PseudoClasses pseudo_classes;
} ToCssOptions;

bool lightningcss_browserslist_to_targets(const char *query,
                                          struct Targets *targets,
                                          struct CssError **error);

struct StyleSheet *lightningcss_stylesheet_parse(const char *source,
                                                 uintptr_t len,
                                                 struct ParseOptions options,
                                                 struct CssError **error);

bool lightningcss_stylesheet_transform(struct StyleSheet *stylesheet,
                                       struct TransformOptions options,
                                       struct CssError **error);

struct ToCssResult lightningcss_stylesheet_to_css(struct StyleSheet *stylesheet,
                                                  struct ToCssOptions options,
                                                  struct CssError **error);

void lightningcss_stylesheet_free(struct StyleSheet *stylesheet);

void lightningcss_to_css_result_free(struct ToCssResult result);

const char *lightningcss_error_message(struct CssError *error);

void lightningcss_error_free(struct CssError *error);

uintptr_t lightningcss_stylesheet_get_warning_count(struct StyleSheet *stylesheet);

const char *lightningcss_stylesheet_get_warning(struct StyleSheet *stylesheet, uintptr_t index);


================================================
FILE: c/src/lib.rs
================================================
#![allow(clippy::not_unsafe_ptr_arg_deref)]

use std::collections::HashSet;
use std::ffi::{CStr, CString};
use std::mem::ManuallyDrop;
use std::os::raw::c_char;
use std::sync::{Arc, RwLock};

use lightningcss::css_modules::PatternParseError;
use lightningcss::error::{Error, MinifyErrorKind, ParserError, PrinterError};
use lightningcss::stylesheet::{MinifyOptions, ParserFlags, ParserOptions, PrinterOptions, StyleSheet};
use lightningcss::targets::Browsers;
use parcel_sourcemap::SourceMap;

pub struct StyleSheetWrapper<'i, 'o> {
  stylesheet: StyleSheet<'i, 'o>,
  source: &'i str,
  warnings: Vec<CssError<'i>>,
}

pub struct CssError<'i> {
  kind: ErrorKind<'i>,
  message: Option<CString>,
}

impl<'i> CssError<'i> {
  fn message(&mut self) -> *const c_char {
    if let Some(message) = &self.message {
      return message.as_ptr();
    }

    let string: String = match &self.kind {
      ErrorKind::ParserError(err) => err.to_string().into(),
      ErrorKind::MinifyError(err) => err.to_string().into(),
      ErrorKind::PrinterError(err) => err.to_string().into(),
      ErrorKind::PatternParseError(err) => err.to_string().into(),
      ErrorKind::BrowserslistError(err) => err.to_string().into(),
      ErrorKind::SourceMapError(err) => err.to_string().into(),
    };

    self.message = Some(CString::new(string).unwrap());
    self.message.as_ref().unwrap().as_ptr()
  }
}

pub enum ErrorKind<'i> {
  ParserError(Error<ParserError<'i>>),
  MinifyError(Error<MinifyErrorKind>),
  PrinterError(PrinterError),
  PatternParseError(PatternParseError),
  BrowserslistError(browserslist::Error),
  SourceMapError(parcel_sourcemap::SourceMapError),
}

macro_rules! impl_from {
  ($name: ident, $t: ty) => {
    impl<'i> From<$t> for CssError<'i> {
      fn from(err: $t) -> Self {
        CssError {
          kind: ErrorKind::$name(err),
          message: None,
        }
      }
    }
  };
}

impl_from!(ParserError, Error<ParserError<'i>>);
impl_from!(MinifyError, Error<MinifyErrorKind>);
impl_from!(PrinterError, PrinterError);
impl_from!(PatternParseError, PatternParseError);
impl_from!(BrowserslistError, browserslist::Error);
impl_from!(SourceMapError, parcel_sourcemap::SourceMapError);

#[repr(C)]
pub struct ParseOptions {
  filename: *const c_char,
  nesting: bool,
  custom_media: bool,
  css_modules: bool,
  css_modules_pattern: *const c_char,
  css_modules_dashed_idents: bool,
  error_recovery: bool,
}

#[repr(C)]
#[derive(Default, PartialEq)]
pub struct Targets {
  android: u32,
  chrome: u32,
  edge: u32,
  firefox: u32,
  ie: u32,
  ios_saf: u32,
  opera: u32,
  safari: u32,
  samsung: u32,
}

impl Into<Browsers> for Targets {
  fn into(self) -> Browsers {
    macro_rules! browser {
      ($val: expr) => {
        if $val > 0 {
          Some($val)
        } else {
          None
        }
      };
    }

    Browsers {
      android: browser!(self.android),
      chrome: browser!(self.chrome),
      edge: browser!(self.edge),
      firefox: browser!(self.firefox),
      ie: browser!(self.ie),
      ios_saf: browser!(self.ios_saf),
      opera: browser!(self.opera),
      safari: browser!(self.safari),
      samsung: browser!(self.samsung),
    }
  }
}

macro_rules! unwrap {
  ($result: expr, $error: ident, $ret: expr) => {
    match $result {
      Ok(v) => v,
      Err(err) => unsafe {
        *$error = Box::into_raw(Box::new(err.into()));
        return $ret;
      },
    }
  };
}

#[no_mangle]
pub extern "C" fn lightningcss_browserslist_to_targets(
  query: *const c_char,
  targets: *mut Targets,
  error: *mut *mut CssError,
) -> bool {
  let string = unsafe { std::str::from_utf8_unchecked(CStr::from_ptr(query).to_bytes()) };
  match Browsers::from_browserslist([string]) {
    Ok(Some(browsers)) => {
      let targets = unsafe { &mut *targets };
      targets.android = browsers.android.unwrap_or_default();
      targets.chrome = browsers.chrome.unwrap_or_default();
      targets.edge = browsers.edge.unwrap_or_default();
      targets.firefox = browsers.firefox.unwrap_or_default();
      targets.ie = browsers.ie.unwrap_or_default();
      targets.ios_saf = browsers.ios_saf.unwrap_or_default();
      targets.opera = browsers.opera.unwrap_or_default();
      targets.safari = browsers.safari.unwrap_or_default();
      targets.samsung = browsers.samsung.unwrap_or_default();
      true
    }
    Ok(None) => true,
    Err(err) => unsafe {
      *error = Box::into_raw(Box::new(err.into()));
      false
    },
  }
}

#[repr(C)]
pub struct TransformOptions {
  targets: Targets,
  unused_symbols: *mut *mut c_char,
  unused_symbols_len: usize,
}

impl Into<MinifyOptions> for TransformOptions {
  fn into(self) -> MinifyOptions {
    let mut unused_symbols = HashSet::new();
    let slice = unsafe { std::slice::from_raw_parts(self.unused_symbols, self.unused_symbols_len) };
    for symbol in slice {
      let string = unsafe { std::str::from_utf8_unchecked(CStr::from_ptr(*symbol).to_bytes()).to_owned() };
      unused_symbols.insert(string);
    }

    MinifyOptions {
      targets: if self.targets != Targets::default() {
        Some(self.targets.into()).into()
      } else {
        Default::default()
      },
      unused_symbols,
    }
  }
}

#[repr(C)]
pub struct ToCssOptions {
  minify: bool,
  source_map: bool,
  input_source_map: *const c_char,
  input_source_map_len: usize,
  project_root: *const c_char,
  targets: Targets,
  analyze_dependencies: bool,
  pseudo_classes: PseudoClasses,
}

#[derive(PartialEq)]
#[repr(C)]
pub struct PseudoClasses {
  hover: *const c_char,
  active: *const c_char,
  focus: *const c_char,
  focus_visible: *const c_char,
  focus_within: *const c_char,
}

impl Default for PseudoClasses {
  fn default() -> Self {
    PseudoClasses {
      hover: std::ptr::null(),
      active: std::ptr::null(),
      focus: std::ptr::null(),
      focus_visible: std::ptr::null(),
      focus_within: std::ptr::null(),
    }
  }
}

impl<'a> Into<lightningcss::printer::PseudoClasses<'a>> for PseudoClasses {
  fn into(self) -> lightningcss::printer::PseudoClasses<'a> {
    macro_rules! pc {
      ($ptr: expr) => {
        if $ptr.is_null() {
          None
        } else {
          Some(unsafe { std::str::from_utf8_unchecked(CStr::from_ptr($ptr).to_bytes()) })
        }
      };
    }

    lightningcss::printer::PseudoClasses {
      hover: pc!(self.hover),
      active: pc!(self.active),
      focus: pc!(self.focus),
      focus_visible: pc!(self.focus_visible),
      focus_within: pc!(self.focus_within),
    }
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_stylesheet_parse(
  source: *const c_char,
  len: usize,
  options: ParseOptions,
  error: *mut *mut CssError,
) -> *mut StyleSheetWrapper {
  let slice = unsafe { std::slice::from_raw_parts(source as *const u8, len) };
  let code = unsafe { std::str::from_utf8_unchecked(slice) };
  let warnings = Arc::new(RwLock::new(Vec::new()));
  let mut flags = ParserFlags::empty();
  flags.set(ParserFlags::CUSTOM_MEDIA, options.custom_media);
  let opts = ParserOptions {
    filename: if options.filename.is_null() {
      String::new()
    } else {
      unsafe { std::str::from_utf8_unchecked(CStr::from_ptr(options.filename).to_bytes()).to_owned() }
    },
    flags,
    css_modules: if options.css_modules {
      let pattern = if !options.css_modules_pattern.is_null() {
        let pattern =
          unsafe { std::str::from_utf8_unchecked(CStr::from_ptr(options.css_modules_pattern).to_bytes()) };
        unwrap!(
          lightningcss::css_modules::Pattern::parse(pattern),
          error,
          std::ptr::null_mut()
        )
      } else {
        lightningcss::css_modules::Pattern::default()
      };
      Some(lightningcss::css_modules::Config {
        pattern,
        dashed_idents: options.css_modules_dashed_idents,
        ..Default::default()
      })
    } else {
      None
    },
    error_recovery: options.error_recovery,
    source_index: 0,
    warnings: Some(warnings.clone()),
  };

  let stylesheet = unwrap!(StyleSheet::parse(code, opts), error, std::ptr::null_mut());
  Box::into_raw(Box::new(StyleSheetWrapper {
    stylesheet,
    source: code,
    warnings: warnings.clone().read().unwrap().iter().map(|w| w.clone().into()).collect(),
  }))
}

#[no_mangle]
pub extern "C" fn lightningcss_stylesheet_transform(
  stylesheet: *mut StyleSheetWrapper,
  options: TransformOptions,
  error: *mut *mut CssError,
) -> bool {
  let wrapper = unsafe { stylesheet.as_mut() }.unwrap();
  unwrap!(wrapper.stylesheet.minify(options.into()), error, false);
  true
}

#[no_mangle]
pub extern "C" fn lightningcss_stylesheet_to_css(
  stylesheet: *mut StyleSheetWrapper,
  options: ToCssOptions,
  error: *mut *mut CssError,
) -> ToCssResult {
  let wrapper = unsafe { stylesheet.as_mut() }.unwrap();
  let mut source_map = if options.source_map {
    let mut sm = SourceMap::new("/");
    sm.add_source(&wrapper.stylesheet.sources[0]);
    unwrap!(sm.set_source_content(0, wrapper.source), error, ToCssResult::default());
    Some(sm)
  } else {
    None
  };

  let opts = PrinterOptions {
    minify: options.minify,
    project_root: if options.project_root.is_null() {
      None
    } else {
      Some(unsafe { std::str::from_utf8_unchecked(CStr::from_ptr(options.project_root).to_bytes()) })
    },
    source_map: source_map.as_mut(),
    targets: if options.targets != Targets::default() {
      Some(options.targets.into()).into()
    } else {
      Default::default()
    },
    analyze_dependencies: if options.analyze_dependencies {
      Some(Default::default())
    } else {
      None
    },
    pseudo_classes: if options.pseudo_classes != PseudoClasses::default() {
      Some(options.pseudo_classes.into())
    } else {
      None
    },
  };

  let res = unwrap!(wrapper.stylesheet.to_css(opts), error, ToCssResult::default());

  let map = if let Some(mut source_map) = source_map {
    if !options.input_source_map.is_null() {
      let slice =
        unsafe { std::slice::from_raw_parts(options.input_source_map as *const u8, options.input_source_map_len) };
      let input_source_map = unsafe { std::str::from_utf8_unchecked(slice) };
      let mut sm = unwrap!(
        SourceMap::from_json("/", input_source_map),
        error,
        ToCssResult::default()
      );
      unwrap!(source_map.extends(&mut sm), error, ToCssResult::default());
    }

    unwrap!(source_map.to_json(None), error, ToCssResult::default()).into()
  } else {
    RawString::default()
  };

  let (exports, exports_len) = if let Some(exports) = res.exports {
    let exports: Vec<CssModuleExport> = exports
      .into_iter()
      .map(|(k, v)| {
        let composes_len = v.composes.len();
        let composes = if !v.composes.is_empty() {
          let composes: Vec<CssModuleReference> = v.composes.into_iter().map(|composes| composes.into()).collect();
          ManuallyDrop::new(composes).as_mut_ptr()
        } else {
          std::ptr::null_mut()
        };

        CssModuleExport {
          exported: k.into(),
          local: v.name.into(),
          is_referenced: v.is_referenced,
          composes,
          composes_len,
        }
      })
      .collect();
    let mut exports = ManuallyDrop::new(exports);
    (exports.as_mut_ptr(), exports.len())
  } else {
    (std::ptr::null_mut(), 0)
  };

  let (references, references_len) = if let Some(references) = res.references {
    let references: Vec<CssModulePlaceholder> = references
      .into_iter()
      .map(|(k, v)| CssModulePlaceholder {
        placeholder: k.into(),
        reference: v.into(),
      })
      .collect();
    let mut references = ManuallyDrop::new(references);
    (references.as_mut_ptr(), references.len())
  } else {
    (std::ptr::null_mut(), 0)
  };

  ToCssResult {
    code: res.code.into(),
    map,
    exports,
    exports_len,
    references,
    references_len,
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_stylesheet_free(stylesheet: *mut StyleSheetWrapper) {
  if !stylesheet.is_null() {
    drop(unsafe { Box::from_raw(stylesheet) })
  }
}

#[repr(C)]
pub struct ToCssResult {
  code: RawString,
  map: RawString,
  exports: *mut CssModuleExport,
  exports_len: usize,
  references: *mut CssModulePlaceholder,
  references_len: usize,
}

impl Default for ToCssResult {
  fn default() -> Self {
    ToCssResult {
      code: RawString::default(),
      map: RawString::default(),
      exports: std::ptr::null_mut(),
      exports_len: 0,
      references: std::ptr::null_mut(),
      references_len: 0,
    }
  }
}

impl Drop for ToCssResult {
  fn drop(&mut self) {
    if !self.exports.is_null() {
      let exports = unsafe { Vec::from_raw_parts(self.exports, self.exports_len, self.exports_len) };
      drop(exports);
      self.exports = std::ptr::null_mut();
    }

    if !self.references.is_null() {
      let references = unsafe { Vec::from_raw_parts(self.references, self.references_len, self.references_len) };
      drop(references);
      self.references = std::ptr::null_mut();
    }
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_to_css_result_free(result: ToCssResult) {
  drop(result)
}

#[repr(C)]
pub struct CssModuleExport {
  exported: RawString,
  local: RawString,
  is_referenced: bool,
  composes: *mut CssModuleReference,
  composes_len: usize,
}

impl Drop for CssModuleExport {
  fn drop(&mut self) {
    if !self.composes.is_null() {
      let composes = unsafe { Vec::from_raw_parts(self.composes, self.composes_len, self.composes_len) };
      drop(composes);
      self.composes = std::ptr::null_mut();
    }
  }
}

#[repr(C)]
pub enum CssModuleReference {
  /// A local reference.
  Local {
    /// The local (compiled) name for the reference.
    name: RawString,
  },
  /// A global reference.
  Global {
    /// The referenced global name.
    name: RawString,
  },
  /// A reference to an export in a different file.
  Dependency {
    /// The name to reference within the dependency.
    name: RawString,
    /// The dependency specifier for the referenced file.
    specifier: RawString,
  },
}

impl From<lightningcss::css_modules::CssModuleReference> for CssModuleReference {
  fn from(reference: lightningcss::css_modules::CssModuleReference) -> Self {
    use lightningcss::css_modules::CssModuleReference::*;
    match reference {
      Local { name } => CssModuleReference::Local { name: name.into() },
      Global { name } => CssModuleReference::Global { name: name.into() },
      Dependency { name, specifier } => CssModuleReference::Dependency {
        name: name.into(),
        specifier: specifier.into(),
      },
    }
  }
}

#[repr(C)]
pub struct CssModulePlaceholder {
  placeholder: RawString,
  reference: CssModuleReference,
}

#[repr(C)]
pub struct RawString {
  text: *mut c_char,
  len: usize,
}

impl Default for RawString {
  fn default() -> Self {
    RawString {
      text: std::ptr::null_mut(),
      len: 0,
    }
  }
}

impl From<String> for RawString {
  fn from(string: String) -> RawString {
    RawString {
      len: string.len(),
      text: Box::into_raw(string.into_boxed_str()) as *mut c_char,
    }
  }
}

impl Drop for RawString {
  fn drop(&mut self) {
    if self.text.is_null() {
      return;
    }
    drop(unsafe { Box::from_raw(self.text) });
    self.text = std::ptr::null_mut();
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_error_message(error: *mut CssError) -> *const c_char {
  match unsafe { error.as_mut() } {
    Some(err) => err.message(),
    None => std::ptr::null(),
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_error_free(error: *mut CssError) {
  if !error.is_null() {
    drop(unsafe { Box::from_raw(error) })
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_stylesheet_get_warning_count<'i>(
  stylesheet: *mut StyleSheetWrapper<'i, '_>,
) -> usize {
  match unsafe { stylesheet.as_mut() } {
    Some(s) => s.warnings.len(),
    None => 0,
  }
}

#[no_mangle]
pub extern "C" fn lightningcss_stylesheet_get_warning<'i>(
  stylesheet: *mut StyleSheetWrapper<'i, '_>,
  index: usize,
) -> *const c_char {
  let stylesheet = match unsafe { stylesheet.as_mut() } {
    Some(s) => s,
    None => return std::ptr::null(),
  };

  match stylesheet.warnings.get_mut(index) {
    Some(w) => w.message(),
    None => std::ptr::null(),
  }
}


================================================
FILE: c/test.c
================================================
#include <stdio.h>
#include <string.h>
#include "lightningcss.h"

int print_error(CssError *error);

int main()
{
  char *source =
      ".foo {"
      "  color: lch(50.998% 135.363 338);"
      "}"
      ".bar {"
      "  color: yellow;"
      "  composes: foo from './bar.css';"
      "}"
      ".baz:hover {"
      "  color: var(--foo from './baz.css');"
      "}";

  ParseOptions parse_opts = {
      .filename = "test.css",
      .css_modules = true,
      .css_modules_pattern = "yo_[name]_[local]",
      .css_modules_dashed_idents = true};

  CssError *error = NULL;
  StyleSheet *stylesheet = lightningcss_stylesheet_parse(source, strlen(source), parse_opts, &error);
  if (!stylesheet)
    goto cleanup;

  char *unused_symbols[1] = {"bar"};
  TransformOptions transform_opts = {
      .unused_symbols = unused_symbols,
      .unused_symbols_len = 0};

  if (!lightningcss_browserslist_to_targets("last 2 versions, not IE <= 11", &transform_opts.targets, &error))
    goto cleanup;

  if (!lightningcss_stylesheet_transform(stylesheet, transform_opts, &error))
    goto cleanup;

  ToCssOptions to_css_opts = {
      .minify = true,
      .source_map = true,
      .pseudo_classes = {
          .hover = "is-hovered"}};

  ToCssResult result = lightningcss_stylesheet_to_css(stylesheet, to_css_opts, &error);
  if (error)
    goto cleanup;

  size_t warning_count = lightningcss_stylesheet_get_warning_count(stylesheet);
  for (size_t i = 0; i < warning_count; i++)
  {
    printf("warning: %s\n", lightningcss_stylesheet_get_warning(stylesheet, i));
  }

  fwrite(result.code.text, sizeof(char), result.code.len, stdout);
  printf("\n");
  fwrite(result.map.text, sizeof(char), result.map.len, stdout);
  printf("\n");

  for (int i = 0; i < result.exports_len; i++)
  {
    printf("%.*s -> %.*s\n", (int)result.exports[i].exported.len, result.exports[i].exported.text, (int)result.exports[i].local.len, result.exports[i].local.text);
    for (int j = 0; j < result.exports[i].composes_len; j++)
    {
      const CssModuleReference *ref = &result.exports[i].composes[j];
      switch (ref->tag)
      {
      case CssModuleReference_Local:
        printf("  composes local: %.*s\n", (int)ref->local.name.len, ref->local.name.text);
        break;
      case CssModuleReference_Global:
        printf("  composes global: %.*s\n", (int)ref->global.name.len, ref->global.name.text);
        break;
      case CssModuleReference_Dependency:
        printf("  composes dependency: %.*s from %.*s\n", (int)ref->dependency.name.len, ref->dependency.name.text, (int)ref->dependency.specifier.len, ref->dependency.specifier.text);
        break;
      }
    }
  }

  for (int i = 0; i < result.references_len; i++)
  {
    printf("placeholder: %.*s\n", (int)result.references[i].placeholder.len, result.references[i].placeholder.text);
  }

cleanup:
  lightningcss_stylesheet_free(stylesheet);
  lightningcss_to_css_result_free(result);

  if (error)
  {
    printf("error: %s\n", lightningcss_error_message(error));
    lightningcss_error_free(error);
    return 1;
  }
}


================================================
FILE: cli/.gitignore
================================================
package.json
README.md
.DS_Store
lightningcss.exe


================================================
FILE: cli/lightningcss
================================================
This file is required so that npm creates the lightningcss binary on Windows.


================================================
FILE: cli/postinstall.js
================================================
let fs = require('fs');
let path = require('path');

let parts = [process.platform, process.arch];
if (process.platform === 'linux') {
  const {MUSL, familySync} = require('detect-libc');
  const family = familySync();
  if (family === MUSL) {
    parts.push('musl');
  } else if (process.arch === 'arm') {
    parts.push('gnueabihf');
  } else {
    parts.push('gnu');
  }
} else if (process.platform === 'win32') {
  parts.push('msvc');
}

let binary = process.platform === 'win32' ? 'lightningcss.exe' : 'lightningcss';

let pkgPath;
try {
  pkgPath = path.dirname(require.resolve(`lightningcss-cli-${parts.join('-')}/package.json`));
} catch (err) {
  pkgPath = path.join(__dirname, '..', 'target', 'release');
  if (!fs.existsSync(path.join(pkgPath, binary))) {
    pkgPath = path.join(__dirname, '..', 'target', 'debug');
  }
}

try {
  fs.linkSync(path.join(pkgPath, binary), path.join(__dirname, binary));
} catch (err) {
  try {
    fs.copyFileSync(path.join(pkgPath, binary), path.join(__dirname, binary));
  } catch (err) {
    console.error('Failed to move lightningcss-cli binary into place.');
    process.exit(1);
  }
}

if (process.platform === 'win32') {
  try {
    fs.unlinkSync(path.join(__dirname, 'lightningcss'));
  } catch (err) { }
}


================================================
FILE: derive/Cargo.toml
================================================
[package]
authors = ["Devon Govett <devongovett@gmail.com>"]
name = "lightningcss-derive"
description = "Derive macros for lightningcss"
version = "1.0.0-alpha.43"
license = "MPL-2.0"
edition = "2021"
repository = "https://github.com/parcel-bundler/lightningcss"

[lib]
proc-macro = true

[dependencies]
syn = { version = "1.0", features = ["extra-traits"] }
quote = "1.0"
proc-macro2 = "1.0"
convert_case = "0.6.0"


================================================
FILE: derive/src/lib.rs
================================================
use proc_macro::TokenStream;

mod parse;
mod to_css;
mod visit;

#[proc_macro_derive(Visit, attributes(visit, skip_visit, skip_type, visit_types))]
pub fn derive_visit_children(input: TokenStream) -> TokenStream {
  visit::derive_visit_children(input)
}

#[proc_macro_derive(Parse, attributes(css))]
pub fn derive_parse(input: TokenStream) -> TokenStream {
  parse::derive_parse(input)
}

#[proc_macro_derive(ToCss, attributes(css))]
pub fn derive_to_css(input: TokenStream) -> TokenStream {
  to_css::derive_to_css(input)
}


================================================
FILE: derive/src/parse.rs
================================================
use convert_case::Casing;
use proc_macro::{self, TokenStream};
use proc_macro2::{Literal, Span, TokenStream as TokenStream2};
use quote::quote;
use syn::{
  parse::Parse, parse_macro_input, parse_quote, Attribute, Data, DataEnum, DeriveInput, Fields, Ident, Token,
};

pub fn derive_parse(input: TokenStream) -> TokenStream {
  let DeriveInput {
    ident,
    data,
    mut generics,
    attrs,
    ..
  } = parse_macro_input!(input);
  let opts = CssOptions::parse_attributes(&attrs).unwrap();
  let cloned_generics = generics.clone();
  let (_, ty_generics, _) = cloned_generics.split_for_impl();

  if generics.lifetimes().next().is_none() {
    generics.params.insert(0, parse_quote! { 'i })
  }

  let lifetime = generics.lifetimes().next().unwrap().clone();
  let (impl_generics, _, where_clause) = generics.split_for_impl();

  let imp = match &data {
    Data::Enum(data) => derive_enum(&data, &ident, &opts),
    _ => todo!(),
  };

  let output = quote! {
    impl #impl_generics Parse<#lifetime> for #ident #ty_generics #where_clause {
      fn parse<'t>(input: &mut Parser<#lifetime, 't>) -> Result<Self, ParseError<#lifetime, ParserError<#lifetime>>> {
        #imp
      }
    }
  };

  output.into()
}

fn derive_enum(data: &DataEnum, ident: &Ident, opts: &CssOptions) -> TokenStream2 {
  let mut idents = Vec::new();
  let mut non_idents = Vec::new();
  for (index, variant) in data.variants.iter().enumerate() {
    let name = &variant.ident;
    let fields = variant
      .fields
      .iter()
      .enumerate()
      .map(|(index, field)| {
        field.ident.as_ref().map_or_else(
          || Ident::new(&format!("_{}", index), Span::call_site()),
          |ident| ident.clone(),
        )
      })
      .collect::<Vec<_>>();

    let mut expr = match &variant.fields {
      Fields::Unit => {
        idents.push((
          Literal::string(&variant.ident.to_string().to_case(opts.case)),
          name.clone(),
        ));
        continue;
      }
      Fields::Named(_) => {
        quote! {
          return Ok(#ident::#name { #(#fields),* })
        }
      }
      Fields::Unnamed(_) => {
        quote! {
          return Ok(#ident::#name(#(#fields),*))
        }
      }
    };

    // Group multiple ident branches together.
    if !idents.is_empty() {
      if idents.len() == 1 {
        let (s, name) = idents.remove(0);
        non_idents.push(quote! {
          if input.try_parse(|input| input.expect_ident_matching(#s)).is_ok() {
            return Ok(#ident::#name)
          }
        });
      } else {
        let matches = idents
          .iter()
          .map(|(s, name)| {
            quote! {
              #s => return Ok(#ident::#name),
            }
          })
          .collect::<Vec<_>>();
        non_idents.push(quote! {
          {
            let state = input.state();
            if let Ok(ident) = input.try_parse(|input| input.expect_ident_cloned()) {
              cssparser::match_ignore_ascii_case! { &*ident,
                #(#matches)*
                _ => {}
              }
              input.reset(&state);
            }
          }
        });
        idents.clear();
      }
    }

    let is_last = index == data.variants.len() - 1;

    for (index, field) in variant.fields.iter().enumerate().rev() {
      let ty = &field.ty;
      let field_name = field.ident.as_ref().map_or_else(
        || Ident::new(&format!("_{}", index), Span::call_site()),
        |ident| ident.clone(),
      );
      if is_last {
        expr = quote! {
          let #field_name = <#ty>::parse(input)?;
          #expr
        };
      } else {
        expr = quote! {
          if let Ok(#field_name) = input.try_parse(<#ty>::parse) {
            #expr
          }
        };
      }
    }

    non_idents.push(expr);
  }

  let idents = if idents.is_empty() {
    quote! {}
  } else if idents.len() == 1 {
    let (s, name) = idents.remove(0);
    quote! {
      input.expect_ident_matching(#s)?;
      Ok(#ident::#name)
    }
  } else {
    let idents = idents
      .into_iter()
      .map(|(s, name)| {
        quote! {
          #s => Ok(#ident::#name),
        }
      })
      .collect::<Vec<_>>();
    quote! {
      let location = input.current_source_location();
      let ident = input.expect_ident()?;
      cssparser::match_ignore_ascii_case! { &*ident,
        #(#idents)*
        _ => Err(location.new_unexpected_token_error(
          cssparser::Token::Ident(ident.clone())
        ))
      }
    }
  };

  let output = quote! {
    #(#non_idents)*
    #idents
  };

  output.into()
}

pub struct CssOptions {
  pub case: convert_case::Case,
}

impl CssOptions {
  pub fn parse_attributes(attrs: &Vec<Attribute>) -> syn::Result<Self> {
    for attr in attrs {
      if attr.path.is_ident("css") {
        let opts: CssOptions = attr.parse_args()?;
        return Ok(opts);
      }
    }

    Ok(CssOptions {
      case: convert_case::Case::Kebab,
    })
  }
}

impl Parse for CssOptions {
  fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
    let mut case = convert_case::Case::Kebab;
    while !input.is_empty() {
      let k: Ident = input.parse()?;
      let _: Token![=] = input.parse()?;
      let v: Ident = input.parse()?;

      if k == "case" {
        if v == "lower" {
          case = convert_case::Case::Flat;
        }
      }
    }

    Ok(Self { case })
  }
}


================================================
FILE: derive/src/to_css.rs
================================================
use convert_case::Casing;
use proc_macro::{self, TokenStream};
use proc_macro2::{Literal, Span, TokenStream as TokenStream2};
use quote::quote;
use syn::{parse_macro_input, Data, DataEnum, DeriveInput, Fields, Ident, Type};

use crate::parse::CssOptions;

pub fn derive_to_css(input: TokenStream) -> TokenStream {
  let DeriveInput {
    ident,
    data,
    generics,
    attrs,
    ..
  } = parse_macro_input!(input);

  let opts = CssOptions::parse_attributes(&attrs).unwrap();
  let (impl_generics, ty_generics, where_clause) = generics.split_for_impl();

  let imp = match &data {
    Data::Enum(data) => derive_enum(&data, &opts),
    _ => todo!(),
  };

  let output = quote! {
    impl #impl_generics ToCss for #ident #ty_generics #where_clause {
      fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
      where
        W: std::fmt::Write,
      {
        #imp
      }
    }
  };

  output.into()
}

fn derive_enum(data: &DataEnum, opts: &CssOptions) -> TokenStream2 {
  let variants = data
    .variants
    .iter()
    .map(|variant| {
      let name = &variant.ident;
      let fields = variant
        .fields
        .iter()
        .enumerate()
        .map(|(index, field)| {
          field.ident.as_ref().map_or_else(
            || Ident::new(&format!("_{}", index), Span::call_site()),
            |ident| ident.clone(),
          )
        })
        .collect::<Vec<_>>();

      #[derive(PartialEq)]
      enum NeedsSpace {
        Yes,
        No,
        Maybe,
      }

      let mut needs_space = NeedsSpace::No;
      let mut fields_iter = variant.fields.iter().zip(fields.iter()).peekable();
      let mut writes = Vec::new();
      let mut has_needs_space = false;
      while let Some((field, name)) = fields_iter.next() {
        writes.push(if fields.len() > 1 {
          let space = match needs_space {
            NeedsSpace::Yes => quote! { dest.write_char(' ')?; },
            NeedsSpace::No => quote! {},
            NeedsSpace::Maybe => {
              has_needs_space = true;
              quote! {
                if needs_space {
                  dest.write_char(' ')?;
                }
              }
            }
          };

          if is_option(&field.ty) {
            needs_space = NeedsSpace::Maybe;
            let after_space = if matches!(fields_iter.peek(), Some((field, _)) if !is_option(&field.ty)) {
              // If the next field is non-optional, just insert the space here.
              needs_space = NeedsSpace::No;
              quote! { dest.write_char(' ')?; }
            } else {
              quote! {}
            };
            quote! {
              if let Some(v) = #name {
                #space
                v.to_css(dest)?;
                #after_space
              }
            }
          } else {
            needs_space = NeedsSpace::Yes;
            quote! {
              #space
              #name.to_css(dest)?;
            }
          }
        } else {
          quote! { #name.to_css(dest) }
        });
      }

      if writes.len() > 1 {
        writes.push(quote! { Ok(()) });
      }

      if has_needs_space {
        writes.insert(0, quote! { let mut needs_space = false });
      }

      match variant.fields {
        Fields::Unit => {
          let s = Literal::string(&variant.ident.to_string().to_case(opts.case));
          quote! {
            Self::#name => dest.write_str(#s)
          }
        }
        Fields::Named(_) => {
          quote! {
            Self::#name { #(#fields),* } => {
              #(#writes)*
            }
          }
        }
        Fields::Unnamed(_) => {
          quote! {
            Self::#name(#(#fields),*) => {
              #(#writes)*
            }
          }
        }
      }
    })
    .collect::<Vec<_>>();

  let output = quote! {
    match self {
      #(#variants),*
    }
  };

  output.into()
}

fn is_option(ty: &Type) -> bool {
  matches!(&ty, Type::Path(p) if p.qself.is_none() && p.path.segments.iter().next().unwrap().ident == "Option")
}


================================================
FILE: derive/src/visit.rs
================================================
use std::collections::HashSet;

use proc_macro::{self, TokenStream};
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::quote;
use syn::{
  parse::Parse, parse_macro_input, parse_quote, Attribute, Data, DataEnum, DeriveInput, Field, Fields,
  GenericParam, Generics, Ident, Member, Token, Type, Visibility,
};

pub fn derive_visit_children(input: TokenStream) -> TokenStream {
  let DeriveInput {
    ident,
    data,
    generics,
    attrs,
    ..
  } = parse_macro_input!(input);

  let options: Vec<VisitOptions> = attrs
    .iter()
    .filter_map(|attr| {
      if attr.path.is_ident("visit") {
        let opts: VisitOptions = attr.parse_args().unwrap();
        Some(opts)
      } else {
        None
      }
    })
    .collect();

  let visit_types = if let Some(attr) = attrs.iter().find(|attr| attr.path.is_ident("visit_types")) {
    let types: VisitTypes = attr.parse_args().unwrap();
    let types = types.types;
    Some(quote! { crate::visit_types!(#(#types)|*) })
  } else {
    None
  };

  if options.is_empty() {
    derive(&ident, &data, &generics, None, visit_types)
  } else {
    options
      .into_iter()
      .map(|options| derive(&ident, &data, &generics, Some(options), visit_types.clone()))
      .collect()
  }
}

fn derive(
  ident: &Ident,
  data: &Data,
  generics: &Generics,
  options: Option<VisitOptions>,
  visit_types: Option<TokenStream2>,
) -> TokenStream {
  let mut impl_generics = generics.clone();
  let mut type_defs = quote! {};
  let generics = if let Some(VisitOptions {
    generic: Some(generic), ..
  }) = &options
  {
    let mappings = generics
      .type_params()
      .zip(generic.type_params())
      .map(|(a, b)| quote! { type #a = #b; });
    type_defs = quote! { #(#mappings)* };
    impl_generics.params.clear();
    generic
  } else {
    &generics
  };

  if impl_generics.lifetimes().next().is_none() {
    impl_generics.params.insert(0, parse_quote! { 'i })
  }

  let lifetime = impl_generics.lifetimes().next().unwrap().clone();
  let t = impl_generics.type_params().find(|g| &g.ident.to_string() == "R");
  let v = quote! { __V };
  let t = if let Some(t) = t {
    GenericParam::Type(t.ident.clone().into())
  } else {
    let t: GenericParam = parse_quote! { __T };
    impl_generics
      .params
      .push(parse_quote! { #t: crate::visitor::Visit<#lifetime, __T, #v> });
    t
  };

  impl_generics
    .params
    .push(parse_quote! { #v: ?Sized + crate::visitor::Visitor<#lifetime, #t> });

  for ty in generics.type_params() {
    let name = &ty.ident;
    impl_generics.make_where_clause().predicates.push(parse_quote! {
      #name: Visit<#lifetime, #t, #v>
    })
  }

  let mut seen_types = HashSet::new();
  let mut child_types = Vec::new();
  let mut visit = Vec::new();
  match data {
    Data::Struct(s) => {
      for (
        index,
        Field {
          vis, ty, ident, attrs, ..
        },
      ) in s.fields.iter().enumerate()
      {
        if attrs.iter().any(|attr| attr.path.is_ident("skip_visit")) {
          continue;
        }

        if matches!(ty, Type::Reference(_)) || !matches!(vis, Visibility::Public(..)) {
          continue;
        }

        if visit_types.is_none() && !seen_types.contains(ty) && !skip_type(attrs) {
          seen_types.insert(ty.clone());
          child_types.push(quote! {
            <#ty as Visit<#lifetime, #t, #v>>::CHILD_TYPES.bits()
          });
        }

        let name = ident
          .as_ref()
          .map_or_else(|| Member::Unnamed(index.into()), |ident| Member::Named(ident.clone()));
        visit.push(quote! { self.#name.visit(visitor)?; })
      }
    }
    Data::Enum(DataEnum { variants, .. }) => {
      let variants = variants
        .iter()
        .map(|variant| {
          let name = &variant.ident;
          let mut field_names = Vec::new();
          let mut visit_fields = Vec::new();
          for (index, Field { ty, ident, attrs, .. }) in variant.fields.iter().enumerate() {
            let name = ident.as_ref().map_or_else(
              || Ident::new(&format!("_{}", index), Span::call_site()),
              |ident| ident.clone(),
            );
            field_names.push(name.clone());

            if matches!(ty, Type::Reference(_)) {
              continue;
            }

            if visit_types.is_none() && !seen_types.contains(ty) && !skip_type(attrs) && !skip_type(&variant.attrs)
            {
              seen_types.insert(ty.clone());
              child_types.push(quote! {
                <#ty as Visit<#lifetime, #t, #v>>::CHILD_TYPES.bits()
              });
            }

            visit_fields.push(quote! { #name.visit(visitor)?; })
          }

          match variant.fields {
            Fields::Unnamed(_) => {
              quote! {
                Self::#name(#(#field_names),*) => {
                  #(#visit_fields)*
                }
              }
            }
            Fields::Named(_) => {
              quote! {
                Self::#name { #(#field_names),* } => {
                  #(#visit_fields)*
                }
              }
            }
            Fields::Unit => quote! {},
          }
        })
        .collect::<proc_macro2::TokenStream>();

      visit.push(quote! {
        match self {
          #variants
          _ => {}
        }
      })
    }
    _ => {}
  }

  if visit_types.is_none() && child_types.is_empty() {
    child_types.push(quote! { crate::visitor::VisitTypes::empty().bits() });
  }

  let (_, ty_generics, _) = generics.split_for_impl();
  let (impl_generics, _, where_clause) = impl_generics.split_for_impl();

  let self_visit = if let Some(VisitOptions {
    visit: Some(visit),
    kind: Some(kind),
    ..
  }) = &options
  {
    child_types.push(quote! { crate::visitor::VisitTypes::#kind.bits() });

    quote! {
      fn visit(&mut self, visitor: &mut #v) -> Result<(), #v::Error> {
        if visitor.visit_types().contains(crate::visitor::VisitTypes::#kind) {
          visitor.#visit(self)
        } else {
          self.visit_children(visitor)
        }
      }
    }
  } else {
    quote! {}
  };

  let child_types = visit_types.unwrap_or_else(|| {
    quote! {
      {
        #type_defs
        crate::visitor::VisitTypes::from_bits_retain(#(#child_types)|*)
      }
    }
  });

  let output = quote! {
    impl #impl_generics Visit<#lifetime, #t, #v> for #ident #ty_generics #where_clause {
      const CHILD_TYPES: crate::visitor::VisitTypes = #child_types;

      #self_visit

      fn visit_children(&mut self, visitor: &mut #v) -> Result<(), #v::Error> {
        if !<Self as Visit<#lifetime, #t, #v>>::CHILD_TYPES.intersects(visitor.visit_types()) {
          return Ok(())
        }

        #(#visit)*

        Ok(())
      }
    }
  };

  output.into()
}

fn skip_type(attrs: &Vec<Attribute>) -> bool {
  attrs.iter().any(|attr| attr.path.is_ident("skip_type"))
}

struct VisitOptions {
  visit: Option<Ident>,
  kind: Option<Ident>,
  generic: Option<Generics>,
}

impl Parse for VisitOptions {
  fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
    let (visit, kind, comma) = if input.peek(Ident) {
      let visit: Ident = input.parse()?;
      let _: Token![,] = input.parse()?;
      let kind: Ident = input.parse()?;
      let comma: Result<Token![,], _> = input.parse();
      (Some(visit), Some(kind), comma.is_ok())
    } else {
      (None, None, true)
    };
    let generic: Option<Generics> = if comma { Some(input.parse()?) } else { None };
    Ok(Self { visit, kind, generic })
  }
}

struct VisitTypes {
  types: Vec<Ident>,
}

impl Parse for VisitTypes {
  fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
    let first: Ident = input.parse()?;
    let mut types = vec![first];
    while input.parse::<Token![|]>().is_ok() {
      let id: Ident = input.parse()?;
      types.push(id);
    }
    Ok(Self { types })
  }
}


================================================
FILE: examples/custom_at_rule.rs
================================================
use std::{collections::HashMap, convert::Infallible};

use cssparser::*;
use lightningcss::{
  declaration::DeclarationBlock,
  error::PrinterError,
  printer::Printer,
  properties::custom::{Token, TokenOrValue},
  rules::{style::StyleRule, CssRule, CssRuleList, Location},
  selector::{Component, Selector},
  stylesheet::{ParserOptions, PrinterOptions, StyleSheet},
  targets::Browsers,
  traits::{AtRuleParser, ToCss},
  values::{
    color::{CssColor, RGBA},
    length::LengthValue,
  },
  vendor_prefix::VendorPrefix,
  visit_types,
  visitor::{Visit, VisitTypes, Visitor},
};

fn main() {
  let args: Vec<String> = std::env::args().collect();
  let source = std::fs::read_to_string(&args[1]).unwrap();
  let opts = ParserOptions {
    filename: args[1].clone(),
    ..Default::default()
  };

  let mut stylesheet = StyleSheet::parse_with(&source, opts, &mut TailwindAtRuleParser).unwrap();

  println!("{:?}", stylesheet);

  let mut style_rules = HashMap::new();
  stylesheet
    .visit(&mut StyleRuleCollector {
      rules: &mut style_rules,
    })
    .unwrap();
  println!("{:?}", style_rules);
  stylesheet.visit(&mut ApplyVisitor { rules: &style_rules }).unwrap();

  let result = stylesheet
    .to_css(PrinterOptions {
      targets: Browsers {
        chrome: Some(100 << 16),
        ..Browsers::default()
      }
      .into(),
      ..PrinterOptions::default()
    })
    .unwrap();
  println!("{}", result.code);
}

/// An @tailwind directive.
#[derive(Debug, Clone)]
enum TailwindDirective {
  Base,
  Components,
  Utilities,
  Variants,
}

/// A custom at rule prelude.
enum Prelude {
  Tailwind(TailwindDirective),
  Apply(Vec<String>),
}

/// A @tailwind rule.
#[derive(Debug, Clone)]
struct TailwindRule {
  directive: TailwindDirective,
  loc: SourceLocation,
}

/// An @apply rule.
#[derive(Debug, Clone)]
struct ApplyRule {
  names: Vec<String>,
  loc: SourceLocation,
}

/// A custom at rule.
#[derive(Debug, Clone)]
enum AtRule {
  Tailwind(TailwindRule),
  Apply(ApplyRule),
}

#[derive(Debug)]
struct TailwindAtRuleParser;
impl<'i> AtRuleParser<'i> for TailwindAtRuleParser {
  type Prelude = Prelude;
  type Error = Infallible;
  type AtRule = AtRule;

  fn parse_prelude<'t>(
    &mut self,
    name: CowRcStr<'i>,
    input: &mut Parser<'i, 't>,
    _options: &ParserOptions<'_, 'i>,
  ) -> Result<Self::Prelude, ParseError<'i, Self::Error>> {
    match_ignore_ascii_case! {&*name,
      "tailwind" => {
        let location = input.current_source_location();
        let ident = input.expect_ident()?;
        let directive = match_ignore_ascii_case! { &*ident,
          "base" => TailwindDirective::Base,
          "components" => TailwindDirective::Components,
          "utilities" => TailwindDirective::Utilities,
          "variants" => TailwindDirective::Variants,
          _ => return Err(location.new_unexpected_token_error(
            cssparser::Token::Ident(ident.clone())
          ))
        };
        Ok(Prelude::Tailwind(directive))
      },
      "apply" => {
        let mut names = Vec::new();
        loop {
          if let Ok(name) = input.try_parse(|input| input.expect_ident_cloned()) {
            names.push(name.as_ref().into());
          } else {
            break
          }
        }

        Ok(Prelude::Apply(names))
      },
      _ => Err(input.new_error(BasicParseErrorKind::AtRuleInvalid(name)))
    }
  }

  fn rule_without_block(
    &mut self,
    prelude: Self::Prelude,
    start: &ParserState,
    _options: &ParserOptions<'_, 'i>,
    _is_nested: bool,
  ) -> Result<Self::AtRule, ()> {
    let loc = start.source_location();
    match prelude {
      Prelude::Tailwind(directive) => Ok(AtRule::Tailwind(TailwindRule { directive, loc })),
      Prelude::Apply(names) => Ok(AtRule::Apply(ApplyRule { names, loc })),
    }
  }
}

struct StyleRuleCollector<'i, 'a> {
  rules: &'a mut HashMap<String, DeclarationBlock<'i>>,
}

impl<'i, 'a> Visitor<'i, AtRule> for StyleRuleCollector<'i, 'a> {
  type Error = Infallible;

  fn visit_types(&self) -> VisitTypes {
    VisitTypes::RULES
  }

  fn visit_rule(&mut self, rule: &mut lightningcss::rules::CssRule<'i, AtRule>) -> Result<(), Self::Error> {
    match rule {
      CssRule::Style(rule) => {
        for selector in rule.selectors.0.iter() {
          if selector.len() != 1 {
            continue; // TODO
          }
          for component in selector.iter_raw_match_order() {
            match component {
              Component::Class(name) => {
                self.rules.insert(name.0.to_string(), rule.declarations.clone());
              }
              _ => {}
            }
          }
        }
      }
      _ => {}
    }

    rule.visit_children(self)
  }
}

struct ApplyVisitor<'a, 'i> {
  rules: &'a HashMap<String, DeclarationBlock<'i>>,
}

impl<'a, 'i> Visitor<'i, AtRule> for ApplyVisitor<'a, 'i> {
  type Error = Infallible;

  fn visit_types(&self) -> VisitTypes {
    visit_types!(RULES | COLORS | LENGTHS | DASHED_IDENTS | SELECTORS | TOKENS)
  }

  fn visit_rule(&mut self, rule: &mut CssRule<'i, AtRule>) -> Result<(), Self::Error> {
    // Replace @apply rule with nested style rule.
    if let CssRule::Custom(AtRule::Apply(apply)) = rule {
      let mut declarations = DeclarationBlock::new();
      for name in &apply.names {
        let Some(applied) = self.rules.get(name) else {
          continue;
        };
        declarations
          .important_declarations
          .extend(applied.important_declarations.iter().cloned());
        declarations.declarations.extend(applied.declarations.iter().cloned());
      }
      *rule = CssRule::Style(StyleRule {
        selectors: Component::Nesting.into(),
        vendor_prefix: VendorPrefix::None,
        declarations,
        rules: CssRuleList(vec![]),
        loc: Location {
          source_index: 0,
          line: apply.loc.line,
          column: apply.loc.column,
        },
      })
    }

    rule.visit_children(self)
  }

  fn visit_url(&mut self, url: &mut lightningcss::values::url::Url<'i>) -> Result<(), Self::Error> {
    url.url = format!("https://mywebsite.com/{}", url.url).into();
    Ok(())
  }

  fn visit_color(&mut self, color: &mut lightningcss::values::color::CssColor) -> Result<(), Self::Error> {
    *color = color.to_lab().unwrap();
    Ok(())
  }

  fn visit_length(&mut self, length: &mut lightningcss::values::length::LengthValue) -> Result<(), Self::Error> {
    match length {
      LengthValue::Px(px) => *length = LengthValue::Rem(*px / 16.0),
      _ => {}
    }

    Ok(())
  }

  fn visit_dashed_ident(
    &mut self,
    ident: &mut lightningcss::values::ident::DashedIdent,
  ) -> Result<(), Self::Error> {
    ident.0 = format!("--tw-{}", &ident.0[2..]).into();
    Ok(())
  }

  fn visit_selector(&mut self, selector: &mut Selector<'i>) -> Result<(), Self::Error> {
    for c in selector.iter_mut_raw_match_order() {
      match c {
        Component::Class(c) => {
          *c = format!("tw-{}", c).into();
        }
        _ => {}
      }
    }

    Ok(())
  }

  fn visit_token(&mut self, token: &mut TokenOrValue<'i>) -> Result<(), Self::Error> {
    match token {
      TokenOrValue::Function(f) if f.name == "theme" => match f.arguments.0.first() {
        Some(TokenOrValue::Token(Token::String(s))) => match s.as_ref() {
          "blue-500" => *token = TokenOrValue::Color(CssColor::RGBA(RGBA::new(0, 0, 255, 1.0))),
          "red-500" => *token = TokenOrValue::Color(CssColor::RGBA(RGBA::new(255, 0, 0, 1.0))),
          _ => {}
        },
        _ => {}
      },
      _ => {}
    }

    token.visit_children(self)
  }
}

#[cfg(feature = "visitor")]
impl<'i, V: Visitor<'i, AtRule>> Visit<'i, AtRule, V> for AtRule {
  const CHILD_TYPES: VisitTypes = VisitTypes::empty();

  fn visit_children(&mut self, _: &mut V) -> Result<(), V::Error> {
    Ok(())
  }
}

impl ToCss for AtRule {
  fn to_css<W: std::fmt::Write>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError> {
    match self {
      AtRule::Tailwind(rule) => {
        let _ = rule.loc; // TODO: source maps
        let directive = match rule.directive {
          TailwindDirective::Base => "TAILWIND BASE HERE",
          TailwindDirective::Components => "TAILWIND COMPONENTS HERE",
          TailwindDirective::Utilities => "TAILWIND UTILITIES HERE",
          TailwindDirective::Variants => "TAILWIND VARIANTS HERE",
        };
        dest.write_str(directive)
      }
      AtRule::Apply(_) => Ok(()),
    }
  }
}


================================================
FILE: examples/schema.rs
================================================
fn main() {
  #[cfg(feature = "jsonschema")]
  {
    let schema = schemars::schema_for!(lightningcss::stylesheet::StyleSheet);
    let output = serde_json::to_string_pretty(&schema).unwrap();
    let _ = std::fs::write("node/ast.json", output);
  }
}


================================================
FILE: examples/serialize.rs
================================================
fn main() {
  parse();
}

#[cfg(feature = "serde")]
fn parse() {
  use lightningcss::stylesheet::{ParserOptions, StyleSheet};
  use std::{env, fs};

  let args: Vec<String> = env::args().collect();
  let contents = fs::read_to_string(&args[1]).unwrap();
  let stylesheet = StyleSheet::parse(
    &contents,
    ParserOptions {
      filename: args[1].clone(),
      ..ParserOptions::default()
    },
  )
  .unwrap();
  let json = serde_json::to_string(&stylesheet).unwrap();
  println!("{}", json);
}

#[cfg(not(feature = "serde"))]
fn parse() {
  panic!("serde feature is not enabled")
}


================================================
FILE: napi/Cargo.toml
================================================
[package]
authors = ["Devon Govett <devongovett@gmail.com>"]
name = "lightningcss-napi"
version = "0.4.8"
description = "Node-API bindings for Lightning CSS"
license = "MPL-2.0"
repository = "https://github.com/parcel-bundler/lightningcss"
edition = "2021"

[features]
default = []
visitor = ["lightningcss/visitor"]
bundler = ["dep:crossbeam-channel", "dep:rayon"]

[dependencies]
serde = { version = "1.0.201", features = ["derive"] }
serde-content = { version = "0.1.2", features = ["serde"] }
serde_bytes = "0.11.5"
cssparser = "0.33.0"
lightningcss = { version = "1.0.0-alpha.71", path = "../", features = [
  "nodejs",
  "serde",
] }
parcel_sourcemap = { version = "2.1.1", features = ["json"] }
serde-detach = "0.0.1"
smallvec = { version = "1.7.0", features = ["union"] }
napi = { version = "2", default-features = false, features = [
  "napi4",
  "napi5",
  "serde-json",
] }
crossbeam-channel = { version = "0.5.6", optional = true }
rayon = { version = "1.5.1", optional = true }


================================================
FILE: napi/src/at_rule_parser.rs
================================================
use std::collections::HashMap;

use cssparser::*;
use lightningcss::{
  declaration::DeclarationBlock,
  error::ParserError,
  rules::{CssRuleList, Location},
  stylesheet::ParserOptions,
  traits::{AtRuleParser, ToCss},
  values::{
    string::CowArcStr,
    syntax::{ParsedComponent, SyntaxString},
  },
};
use serde::{Deserialize, Deserializer, Serialize};

#[derive(Deserialize, Debug, Clone)]
pub struct CustomAtRuleConfig {
  #[serde(default, deserialize_with = "deserialize_prelude")]
  prelude: Option<SyntaxString>,
  body: Option<CustomAtRuleBodyType>,
}

fn deserialize_prelude<'de, D>(deserializer: D) -> Result<Option<SyntaxString>, D::Error>
where
  D: Deserializer<'de>,
{
  let s = Option::<CowArcStr<'de>>::deserialize(deserializer)?;
  if let Some(s) = s {
    Ok(Some(
      SyntaxString::parse_string(&s).map_err(|_| serde::de::Error::custom("invalid syntax string"))?,
    ))
  } else {
    Ok(None)
  }
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "kebab-case")]
enum CustomAtRuleBodyType {
  DeclarationList,
  RuleList,
  StyleBlock,
}

pub struct Prelude<'i> {
  name: CowArcStr<'i>,
  prelude: Option<ParsedComponent<'i>>,
}

#[derive(Serialize, Deserialize, Clone)]
pub struct AtRule<'i> {
  #[serde(borrow)]
  pub name: CowArcStr<'i>,
  pub prelude: Option<ParsedComponent<'i>>,
  pub body: Option<AtRuleBody<'i>>,
  pub loc: Location,
}

#[derive(Serialize, Deserialize, Clone)]
#[serde(tag = "type", content = "value", rename_all = "kebab-case")]
pub enum AtRuleBody<'i> {
  #[serde(borrow)]
  DeclarationList(DeclarationBlock<'i>),
  RuleList(CssRuleList<'i, AtRule<'i>>),
}

#[derive(Clone)]
pub struct CustomAtRuleParser {
  pub configs: HashMap<String, CustomAtRuleConfig>,
}

impl<'i> AtRuleParser<'i> for CustomAtRuleParser {
  type Prelude = Prelude<'i>;
  type Error = ParserError<'i>;
  type AtRule = AtRule<'i>;

  fn parse_prelude<'t>(
    &mut self,
    name: CowRcStr<'i>,
    input: &mut Parser<'i, 't>,
    _options: &ParserOptions<'_, 'i>,
  ) -> Result<Self::Prelude, ParseError<'i, Self::Error>> {
    if let Some(config) = self.configs.get(name.as_ref()) {
      let prelude = if let Some(prelude) = &config.prelude {
        Some(prelude.parse_value(input)?)
      } else {
        None
      };
      Ok(Prelude {
        name: name.into(),
        prelude,
      })
    } else {
      Err(input.new_error(BasicParseErrorKind::AtRuleInvalid(name)))
    }
  }

  fn parse_block<'t>(
    &mut self,
    prelude: Self::Prelude,
    start: &ParserState,
    input: &mut Parser<'i, 't>,
    options: &ParserOptions<'_, 'i>,
    is_nested: bool,
  ) -> Result<Self::AtRule, ParseError<'i, Self::Error>> {
    let config = self.configs.get(prelude.name.as_ref()).unwrap();
    let body = if let Some(body) = &config.body {
      match body {
        CustomAtRuleBodyType::DeclarationList => {
          Some(AtRuleBody::DeclarationList(DeclarationBlock::parse(input, options)?))
        }
        CustomAtRuleBodyType::RuleList => {
          Some(AtRuleBody::RuleList(CssRuleList::parse_with(input, options, self)?))
        }
        CustomAtRuleBodyType::StyleBlock => Some(AtRuleBody::RuleList(CssRuleList::parse_style_block_with(
          input, options, self, is_nested,
        )?)),
      }
    } else {
      return Err(input.new_error(BasicParseErrorKind::AtRuleBodyInvalid));
    };

    let loc = start.source_location();
    Ok(AtRule {
      name: prelude.name,
      prelude: prelude.prelude,
      body,
      loc: Location {
        source_index: options.source_index,
        line: loc.line,
        column: loc.column,
      },
    })
  }

  fn rule_without_block(
    &mut self,
    prelude: Self::Prelude,
    start: &ParserState,
    options: &ParserOptions<'_, 'i>,
    _is_nested: bool,
  ) -> Result<Self::AtRule, ()> {
    let config = self.configs.get(prelude.name.as_ref()).unwrap();
    if config.body.is_some() {
      return Err(());
    }

    let loc = start.source_location();
    Ok(AtRule {
      name: prelude.name,
      prelude: prelude.prelude,
      body: None,
      loc: Location {
        source_index: options.source_index,
        line: loc.line,
        column: loc.column,
      },
    })
  }
}

impl<'i> ToCss for AtRule<'i> {
  fn to_css<W>(
    &self,
    dest: &mut lightningcss::printer::Printer<W>,
  ) -> Result<(), lightningcss::error::PrinterError>
  where
    W: std::fmt::Write,
  {
    dest.write_char('@')?;
    serialize_identifier(&self.name, dest)?;
    if let Some(prelude) = &self.prelude {
      dest.write_char(' ')?;
      prelude.to_css(dest)?;
    }

    if let Some(body) = &self.body {
      match body {
        AtRuleBody::DeclarationList(decls) => {
          decls.to_css_block(dest)?;
        }
        AtRuleBody::RuleList(rules) => {
          dest.whitespace()?;
          dest.write_char('{')?;
          dest.indent();
          dest.newline()?;
          rules.to_css(dest)?;
          dest.dedent();
          dest.newline()?;
          dest.write_char('}')?;
        }
      }
    }

    Ok(())
  }
}

#[cfg(feature = "visitor")]
use lightningcss::visitor::{Visit, VisitTypes, Visitor};

#[cfg(feature = "visitor")]
impl<'i, V: Visitor<'i, AtRule<'i>>> Visit<'i, AtRule<'i>, V> for AtRule<'i> {
  const CHILD_TYPES: VisitTypes = VisitTypes::empty();

  fn visit_children(&mut self, visitor: &mut V) -> Result<(), V::Error> {
    self.prelude.visit(visitor)?;
    match &mut self.body {
      Some(AtRuleBody::DeclarationList(decls)) => decls.visit(visitor),
      Some(AtRuleBody::RuleList(rules)) => rules.visit(visitor),
      None => Ok(()),
    }
  }
}


================================================
FILE: napi/src/lib.rs
================================================
#[cfg(feature = "bundler")]
use at_rule_parser::AtRule;
use at_rule_parser::{CustomAtRuleConfig, CustomAtRuleParser};
use lightningcss::bundler::BundleErrorKind;
#[cfg(feature = "bundler")]
use lightningcss::bundler::{Bundler, SourceProvider};
use lightningcss::css_modules::{CssModuleExports, CssModuleReferences, PatternParseError};
use lightningcss::dependencies::{Dependency, DependencyOptions};
use lightningcss::error::{Error, ErrorLocation, MinifyErrorKind, ParserError, PrinterErrorKind};
use lightningcss::stylesheet::{
  MinifyOptions, ParserFlags, ParserOptions, PrinterOptions, PseudoClasses, StyleAttribute, StyleSheet,
};
use lightningcss::targets::{Browsers, Features, Targets};
use napi::bindgen_prelude::{FromNapiValue, ToNapiValue};
use napi::{CallContext, Env, JsObject, JsUnknown};
use parcel_sourcemap::SourceMap;
use serde::{Deserialize, Serialize};
use std::collections::{HashMap, HashSet};
use std::sync::{Arc, RwLock};

mod at_rule_parser;
#[cfg(feature = "bundler")]
#[cfg(not(target_arch = "wasm32"))]
mod threadsafe_function;
#[cfg(feature = "visitor")]
mod transformer;
mod utils;

#[cfg(feature = "visitor")]
use transformer::JsVisitor;

#[cfg(not(feature = "visitor"))]
struct JsVisitor;

#[cfg(feature = "visitor")]
use lightningcss::visitor::Visit;

use utils::get_named_property;

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct TransformResult<'i> {
  #[serde(with = "serde_bytes")]
  code: Vec<u8>,
  #[serde(with = "serde_bytes")]
  map: Option<Vec<u8>>,
  exports: Option<CssModuleExports>,
  references: Option<CssModuleReferences>,
  dependencies: Option<Vec<Dependency>>,
  warnings: Vec<Warning<'i>>,
}

impl<'i> TransformResult<'i> {
  fn into_js(self, env: Env) -> napi::Result<JsUnknown> {
    // Manually construct buffers so we avoid a copy and work around
    // https://github.com/napi-rs/napi-rs/issues/1124.
    let mut obj = env.create_object()?;
    let buf = env.create_buffer_with_data(self.code)?;
    obj.set_named_property("code", buf.into_raw())?;
    obj.set_named_property(
      "map",
      if let Some(map) = self.map {
        let buf = env.create_buffer_with_data(map)?;
        buf.into_raw().into_unknown()
      } else {
        env.get_null()?.into_unknown()
      },
    )?;
    obj.set_named_property("exports", env.to_js_value(&self.exports)?)?;
    obj.set_named_property("references", env.to_js_value(&self.references)?)?;
    obj.set_named_property("dependencies", env.to_js_value(&self.dependencies)?)?;
    obj.set_named_property("warnings", env.to_js_value(&self.warnings)?)?;
    Ok(obj.into_unknown())
  }
}

#[cfg(feature = "visitor")]
fn get_visitor(env: Env, opts: &JsObject) -> Option<JsVisitor> {
  if let Ok(visitor) = get_named_property::<JsObject>(opts, "visitor") {
    Some(JsVisitor::new(env, visitor))
  } else {
    None
  }
}

#[cfg(not(feature = "visitor"))]
fn get_visitor(_env: Env, _opts: &JsObject) -> Option<JsVisitor> {
  None
}

pub fn transform(ctx: CallContext) -> napi::Result<JsUnknown> {
  let opts = ctx.get::<JsObject>(0)?;
  let mut visitor = get_visitor(*ctx.env, &opts);

  let config: Config = ctx.env.from_js_value(opts)?;
  let code = unsafe { std::str::from_utf8_unchecked(&config.code) };
  let res = compile(code, &config, &mut visitor);

  match res {
    Ok(res) => res.into_js(*ctx.env),
    Err(err) => Err(err.into_js_error(*ctx.env, Some(code))?),
  }
}

pub fn transform_style_attribute(ctx: CallContext) -> napi::Result<JsUnknown> {
  let opts = ctx.get::<JsObject>(0)?;
  let mut visitor = get_visitor(*ctx.env, &opts);

  let config: AttrConfig = ctx.env.from_js_value(opts)?;
  let code = unsafe { std::str::from_utf8_unchecked(&config.code) };
  let res = compile_attr(code, &config, &mut visitor);

  match res {
    Ok(res) => res.into_js(ctx),
    Err(err) => Err(err.into_js_error(*ctx.env, Some(code))?),
  }
}

#[cfg(feature = "bundler")]
#[cfg(not(target_arch = "wasm32"))]
mod bundle {
  use super::*;
  use crossbeam_channel::{self, Receiver, Sender};
  use lightningcss::bundler::{FileProvider, ResolveResult};
  use napi::{Env, JsBoolean, JsFunction, JsString, NapiRaw};
  use std::path::{Path, PathBuf};
  use std::str::FromStr;
  use std::sync::Mutex;
  use threadsafe_function::{ThreadSafeCallContext, ThreadsafeFunction, ThreadsafeFunctionCallMode};

  pub fn bundle(ctx: CallContext) -> napi::Result<JsUnknown> {
    let opts = ctx.get::<JsObject>(0)?;
    let mut visitor = get_visitor(*ctx.env, &opts);

    let config: BundleConfig = ctx.env.from_js_value(opts)?;
    let fs = FileProvider::new();

    // This is pretty silly, but works around a rust limitation that you cannot
    // explicitly annotate lifetime bounds on closures.
    fn annotate<'i, 'o, F>(f: F) -> F
    where
      F: FnOnce(&mut StyleSheet<'i, 'o, AtRule<'i>>) -> napi::Result<()>,
    {
      f
    }

    let res = compile_bundle(
      &fs,
      &config,
      visitor.as_mut().map(|visitor| annotate(|stylesheet| stylesheet.visit(visitor))),
    );

    match res {
      Ok(res) => res.into_js(*ctx.env),
      Err(err) => Err(err.into_js_error(*ctx.env, None)?),
    }
  }

  // A SourceProvider which calls JavaScript functions to resolve and read files.
  struct JsSourceProvider {
    resolve: Option<ThreadsafeFunction<ResolveMessage>>,
    read: Option<ThreadsafeFunction<ReadMessage>>,
    inputs: Mutex<Vec<*mut String>>,
  }

  unsafe impl Sync for JsSourceProvider {}
  unsafe impl Send for JsSourceProvider {}

  // Allocate a single channel per thread to communicate with the JS thread.
  thread_local! {
    static CHANNEL: (Sender<napi::Result<String>>, Receiver<napi::Result<String>>) = crossbeam_channel::unbounded();
    static RESOLVER_CHANNEL: (Sender<napi::Result<ResolveResult>>, Receiver<napi::Result<ResolveResult>>) = crossbeam_channel::unbounded();
  }

  impl SourceProvider for JsSourceProvider {
    type Error = napi::Error;

    fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
      let source = if let Some(read) = &self.read {
        CHANNEL.with(|channel| {
          let message = ReadMessage {
            file: file.to_str().unwrap().to_owned(),
            tx: channel.0.clone(),
          };

          read.call(message, ThreadsafeFunctionCallMode::Blocking);
          channel.1.recv().unwrap()
        })
      } else {
        Ok(std::fs::read_to_string(file)?)
      };

      match source {
        Ok(source) => {
          // cache the result
          let ptr = Box::into_raw(Box::new(source));
          self.inputs.lock().unwrap().push(ptr);
          // SAFETY: this is safe because the pointer is not dropped
          // until the JsSourceProvider is, and we never remove from the
          // list of pointers stored in the vector.
          Ok(unsafe { &*ptr })
        }
        Err(e) => Err(e),
      }
    }

    fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<ResolveResult, Self::Error> {
      if let Some(resolve) = &self.resolve {
        return RESOLVER_CHANNEL.with(|channel| {
          let message = ResolveMessage {
            specifier: specifier.to_owned(),
            originating_file: originating_file.to_str().unwrap().to_owned(),
            tx: channel.0.clone(),
          };

          resolve.call(message, ThreadsafeFunctionCallMode::Blocking);
          channel.1.recv().unwrap()
        });
      }

      Ok(originating_file.with_file_name(specifier).into())
    }
  }

  struct ResolveMessage {
    specifier: String,
    originating_file: String,
    tx: Sender<napi::Result<ResolveResult>>,
  }

  struct ReadMessage {
    file: String,
    tx: Sender<napi::Result<String>>,
  }

  struct VisitMessage {
    stylesheet: &'static mut StyleSheet<'static, 'static, AtRule<'static>>,
    tx: Sender<napi::Result<String>>,
  }

  fn await_promise<T, Cb>(env: Env, result: JsUnknown, tx: Sender<napi::Result<T>>, parse: Cb) -> napi::Result<()>
  where
    T: 'static,
    Cb: 'static + Fn(JsUnknown) -> Result<T, napi::Error>,
  {
    // If the result is a promise, wait for it to resolve, and send the result to the channel.
    // Otherwise, send the result immediately.
    if result.is_promise()? {
      let result: JsObject = result.try_into()?;
      let then: JsFunction = get_named_property(&result, "then")?;
      let tx2 = tx.clone();
      let cb = env.create_function_from_closure("callback", move |ctx| {
        let res = parse(ctx.get::<JsUnknown>(0)?)?;
        tx.send(Ok(res)).unwrap();
        ctx.env.get_undefined()
      })?;
      let eb = env.create_function_from_closure("error_callback", move |ctx| {
        let res = ctx.get::<JsUnknown>(0)?;
        tx2.send(Err(napi::Error::from(res))).unwrap();
        ctx.env.get_undefined()
      })?;
      then.call(Some(&result), &[cb, eb])?;
    } else {
      let result = parse(result)?;
      tx.send(Ok(result)).unwrap();
    }

    Ok(())
  }

  fn resolve_on_js_thread(ctx: ThreadSafeCallContext<ResolveMessage>) -> napi::Result<()> {
    let specifier = ctx.env.create_string(&ctx.value.specifier)?;
    let originating_file = ctx.env.create_string(&ctx.value.originating_file)?;
    let result = ctx.callback.unwrap().call(None, &[specifier, originating_file])?;
    await_promise(ctx.env, result, ctx.value.tx, move |unknown| {
      ctx.env.from_js_value(unknown)
    })
  }

  fn handle_error<T>(tx: Sender<napi::Result<T>>, res: napi::Result<()>) -> napi::Result<()> {
    match res {
      Ok(_) => Ok(()),
      Err(e) => {
        tx.send(Err(e)).expect("send error");
        Ok(())
      }
    }
  }

  fn resolve_on_js_thread_wrapper(ctx: ThreadSafeCallContext<ResolveMessage>) -> napi::Result<()> {
    let tx = ctx.value.tx.clone();
    handle_error(tx, resolve_on_js_thread(ctx))
  }

  fn read_on_js_thread(ctx: ThreadSafeCallContext<ReadMessage>) -> napi::Result<()> {
    let file = ctx.env.create_string(&ctx.value.file)?;
    let result = ctx.callback.unwrap().call(None, &[file])?;
    await_promise(ctx.env, result, ctx.value.tx, |unknown| {
      JsString::try_from(unknown)?.into_utf8()?.into_owned()
    })
  }

  fn read_on_js_thread_wrapper(ctx: ThreadSafeCallContext<ReadMessage>) -> napi::Result<()> {
    let tx = ctx.value.tx.clone();
    handle_error(tx, read_on_js_thread(ctx))
  }

  pub fn bundle_async(ctx: CallContext) -> napi::Result<JsObject> {
    let opts = ctx.get::<JsObject>(0)?;
    let visitor = get_visitor(*ctx.env, &opts);

    let config: BundleConfig = ctx.env.from_js_value(&opts)?;

    if let Ok(resolver) = get_named_property::<JsObject>(&opts, "resolver") {
      let read = if resolver.has_named_property("read")? {
        let read = get_named_property::<JsFunction>(&resolver, "read")?;
        Some(ThreadsafeFunction::create(
          ctx.env.raw(),
          unsafe { read.raw() },
          0,
          read_on_js_thread_wrapper,
        )?)
      } else {
        None
      };

      let resolve = if resolver.has_named_property("resolve")? {
        let resolve = get_named_property::<JsFunction>(&resolver, "resolve")?;
        Some(ThreadsafeFunction::create(
          ctx.env.raw(),
          unsafe { resolve.raw() },
          0,
          resolve_on_js_thread_wrapper,
        )?)
      } else {
        None
      };

      let provider = JsSourceProvider {
        resolve,
        read,
        inputs: Mutex::new(Vec::new()),
      };

      run_bundle_task(provider, config, visitor, *ctx.env)
    } else {
      let provider = FileProvider::new();
      run_bundle_task(provider, config, visitor, *ctx.env)
    }
  }

  // Runs bundling on a background thread managed by rayon. This is similar to AsyncTask from napi-rs, however,
  // because we call back into the JS thread, which might call other tasks in the node threadpool (e.g. fs.readFile),
  // we may end up deadlocking if the number of rayon threads exceeds node's threadpool size. Therefore, we must
  // run bundling from a thread not managed by Node.
  fn run_bundle_task<P: 'static + SourceProvider>(
    provider: P,
    config: BundleConfig,
    visitor: Option<JsVisitor>,
    env: Env,
  ) -> napi::Result<JsObject>
  where
    P::Error: IntoJsError,
  {
    let (deferred, promise) = env.create_deferred()?;

    let tsfn = if let Some(mut visitor) = visitor {
      Some(ThreadsafeFunction::create(
        env.raw(),
        std::ptr::null_mut(),
        0,
        move |ctx: ThreadSafeCallContext<VisitMessage>| {
          if let Err(err) = ctx.value.stylesheet.visit(&mut visitor) {
            ctx.value.tx.send(Err(err)).expect("send error");
            return Ok(());
          }
          ctx.value.tx.send(Ok(Default::default())).expect("send error");
          Ok(())
        },
      )?)
    } else {
      None
    };

    // Run bundling task in rayon threadpool.
    rayon::spawn(move || {
      let res = compile_bundle(
        unsafe { std::mem::transmute::<&'_ P, &'static P>(&provider) },
        &config,
        tsfn.map(move |tsfn| {
          move |stylesheet: &mut StyleSheet<AtRule>| {
            CHANNEL.with(|channel| {
              let message = VisitMessage {
                // SAFETY: we immediately lock the thread until we get a response,
                // so stylesheet cannot be dropped in that time.
                stylesheet: unsafe {
                  std::mem::transmute::<
                    &'_ mut StyleSheet<'_, '_, AtRule>,
                    &'static mut StyleSheet<'static, 'static, AtRule>,
                  >(stylesheet)
                },
                tx: channel.0.clone(),
              };

              tsfn.call(message, ThreadsafeFunctionCallMode::Blocking);
              channel.1.recv().expect("recv error").map(|_| ())
            })
          }
        }),
      );

      deferred.resolve(move |env| match res {
        Ok(v) => v.into_js(env),
        Err(err) => Err(err.into_js_error(env, None)?),
      });
    });

    Ok(promise)
  }
}

#[cfg(feature = "bundler")]
#[cfg(target_arch = "wasm32")]
mod bundle {
  use super::*;
  use lightningcss::bundler::ResolveResult;
  use napi::{Env, JsFunction, JsString, NapiRaw, NapiValue, Ref};
  use std::cell::UnsafeCell;
  use std::path::Path;

  pub fn bundle(ctx: CallContext) -> napi::Result<JsUnknown> {
    let opts = ctx.get::<JsObject>(0)?;
    let mut visitor = get_visitor(*ctx.env, &opts);

    let resolver = get_named_property::<JsObject>(&opts, "resolver")?;
    let read = get_named_property::<JsFunction>(&resolver, "read")?;
    let resolve = if resolver.has_named_property("resolve")? {
      let resolve = get_named_property::<JsFunction>(&resolver, "resolve")?;
      Some(ctx.env.create_reference(resolve)?)
    } else {
      None
    };
    let config: BundleConfig = ctx.env.from_js_value(opts)?;

    let provider = JsSourceProvider {
      env: ctx.env.clone(),
      resolve,
      read: ctx.env.create_reference(read)?,
      inputs: UnsafeCell::new(Vec::new()),
    };

    // This is pretty silly, but works around a rust limitation that you cannot
    // explicitly annotate lifetime bounds on closures.
    fn annotate<'i, 'o, F>(f: F) -> F
    where
      F: FnOnce(&mut StyleSheet<'i, 'o, AtRule<'i>>) -> napi::Result<()>,
    {
      f
    }

    let res = compile_bundle(
      &provider,
      &config,
      visitor.as_mut().map(|visitor| annotate(|stylesheet| stylesheet.visit(visitor))),
    );

    match res {
      Ok(res) => res.into_js(*ctx.env),
      Err(err) => Err(err.into_js_error(*ctx.env, None)?),
    }
  }

  struct JsSourceProvider {
    env: Env,
    resolve: Option<Ref<()>>,
    read: Ref<()>,
    inputs: UnsafeCell<Vec<*mut String>>,
  }

  impl Drop for JsSourceProvider {
    fn drop(&mut self) {
      if let Some(resolve) = &mut self.resolve {
        drop(resolve.unref(self.env));
      }
      drop(self.read.unref(self.env));
    }
  }

  unsafe impl Sync for JsSourceProvider {}
  unsafe impl Send for JsSourceProvider {}

  // This relies on Binaryen's Asyncify transform to allow Rust to call async JS functions from sync code.
  // See the comments in async.mjs for more details about how this works.
  extern "C" {
    fn await_promise_sync(
      promise: napi::sys::napi_value,
      result: *mut napi::sys::napi_value,
      error: *mut napi::sys::napi_value,
    );
  }

  fn get_result(env: Env, mut value: JsUnknown) -> napi::Result<JsUnknown> {
    if value.is_promise()? {
      let mut result = std::ptr::null_mut();
      let mut error = std::ptr::null_mut();
      unsafe { await_promise_sync(value.raw(), &mut result, &mut error) };
      if !error.is_null() {
        let error = unsafe { JsUnknown::from_raw(env.raw(), error)? };
        return Err(napi::Error::from(error));
      }
      if result.is_null() {
        return Err(napi::Error::new(napi::Status::GenericFailure, "No result".to_string()));
      }

      value = unsafe { JsUnknown::from_raw(env.raw(), result)? };
    }

    Ok(value)
  }

  impl SourceProvider for JsSourceProvider {
    type Error = napi::Error;

    fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
      let read: JsFunction = self.env.get_reference_value_unchecked(&self.read)?;
      let file = self.env.create_string(file.to_str().unwrap())?;
      let source: JsUnknown = read.call(None, &[file])?;
      let source = get_result(self.env, source)?;
      let source: JsString = source.try_into()?;
      let source = source.into_utf8()?.into_owned()?;

      // cache the result
      let ptr = Box::into_raw(Box::new(source));
      let inputs = unsafe { &mut *self.inputs.get() };
      inputs.push(ptr);
      // SAFETY: this is safe because the pointer is not dropped
      // until the JsSourceProvider is, and we never remove from the
      // list of pointers stored in the vector.
      Ok(unsafe { &*ptr })
    }

    fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<ResolveResult, Self::Error> {
      if let Some(resolve) = &self.resolve {
        let resolve: JsFunction = self.env.get_reference_value_unchecked(resolve)?;
        let specifier = self.env.create_string(specifier)?;
        let originating_file = self.env.create_string(originating_file.to_str().unwrap())?;
        let result: JsUnknown = resolve.call(None, &[specifier, originating_file])?;
        let result = get_result(self.env, result)?;
        let result = self.env.from_js_value(result)?;
        Ok(result)
      } else {
        Ok(ResolveResult::File(originating_file.with_file_name(specifier)))
      }
    }
  }
}

#[cfg(feature = "bundler")]
pub use bundle::*;

// ---------------------------------------------

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct Config {
  pub filename: Option<String>,
  pub project_root: Option<String>,
  #[serde(with = "serde_bytes")]
  pub code: Vec<u8>,
  pub targets: Option<Browsers>,
  #[serde(default)]
  pub include: u32,
  #[serde(default)]
  pub exclude: u32,
  pub minify: Option<bool>,
  pub source_map: Option<bool>,
  pub input_source_map: Option<String>,
  pub drafts: Option<Drafts>,
  pub non_standard: Option<NonStandard>,
  pub css_modules: Option<CssModulesOption>,
  pub analyze_dependencies: Option<AnalyzeDependenciesOption>,
  pub pseudo_classes: Option<OwnedPseudoClasses>,
  pub unused_symbols: Option<HashSet<String>>,
  pub error_recovery: Option<bool>,
  pub custom_at_rules: Option<HashMap<String, CustomAtRuleConfig>>,
}

#[derive(Debug, Deserialize)]
#[serde(untagged)]
enum AnalyzeDependenciesOption {
  Bool(bool),
  Config(AnalyzeDependenciesConfig),
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct AnalyzeDependenciesConfig {
  preserve_imports: bool,
}

#[derive(Debug, Deserialize)]
#[serde(untagged)]
enum CssModulesOption {
  Bool(bool),
  Config(CssModulesConfig),
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct CssModulesConfig {
  pattern: Option<String>,
  dashed_idents: Option<bool>,
  animation: Option<bool>,
  container: Option<bool>,
  grid: Option<bool>,
  custom_idents: Option<bool>,
  pure: Option<bool>,
}

#[cfg(feature = "bundler")]
#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct BundleConfig {
  pub filename: String,
  pub project_root: Option<String>,
  pub targets: Option<Browsers>,
  #[serde(default)]
  pub include: u32,
  #[serde(default)]
  pub exclude: u32,
  pub minify: Option<bool>,
  pub source_map: Option<bool>,
  pub drafts: Option<Drafts>,
  pub non_standard: Option<NonStandard>,
  pub css_modules: Option<CssModulesOption>,
  pub analyze_dependencies: Option<AnalyzeDependenciesOption>,
  pub pseudo_classes: Option<OwnedPseudoClasses>,
  pub unused_symbols: Option<HashSet<String>>,
  pub error_recovery: Option<bool>,
  pub custom_at_rules: Option<HashMap<String, CustomAtRuleConfig>>,
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct OwnedPseudoClasses {
  pub hover: Option<String>,
  pub active: Option<String>,
  pub focus: Option<String>,
  pub focus_visible: Option<String>,
  pub focus_within: Option<String>,
}

impl<'a> Into<PseudoClasses<'a>> for &'a OwnedPseudoClasses {
  fn into(self) -> PseudoClasses<'a> {
    PseudoClasses {
      hover: self.hover.as_deref(),
      active: self.active.as_deref(),
      focus: self.focus.as_deref(),
      focus_visible: self.focus_visible.as_deref(),
      focus_within: self.focus_within.as_deref(),
    }
  }
}

#[derive(Serialize, Debug, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
struct Drafts {
  #[serde(default)]
  custom_media: bool,
}

#[derive(Serialize, Debug, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
struct NonStandard {
  #[serde(default)]
  deep_selector_combinator: bool,
}

fn compile<'i>(
  code: &'i str,
  config: &Config,
  #[allow(unused_variables)] visitor: &mut Option<JsVisitor>,
) -> Result<TransformResult<'i>, CompileError<'i, napi::Error>> {
  let drafts = config.drafts.as_ref();
  let non_standard = config.non_standard.as_ref();
  let warnings = Some(Arc::new(RwLock::new(Vec::new())));

  let filename = config.filename.clone().unwrap_or_default();
  let project_root = config.project_root.as_ref().map(|p| p.as_ref());
  let mut source_map = if config.source_map.unwrap_or_default() {
    let mut sm = SourceMap::new(project_root.unwrap_or("/"));
    sm.add_source(&filename);
    sm.set_source_content(0, code)?;
    Some(sm)
  } else {
    None
  };

  let res = {
    let mut flags = ParserFlags::empty();
    flags.set(ParserFlags::CUSTOM_MEDIA, matches!(drafts, Some(d) if d.custom_media));
    flags.set(
      ParserFlags::DEEP_SELECTOR_COMBINATOR,
      matches!(non_standard, Some(v) if v.deep_selector_combinator),
    );

    let mut stylesheet = StyleSheet::parse_with(
      &code,
      ParserOptions {
        filename: filename.clone(),
        flags,
        css_modules: if let Some(css_modules) = &config.css_modules {
          match css_modules {
            CssModulesOption::Bool(true) => Some(lightningcss::css_modules::Config::default()),
            CssModulesOption::Bool(false) => None,
            CssModulesOption::Config(c) => Some(lightningcss::css_modules::Config {
              pattern: if let Some(pattern) = c.pattern.as_ref() {
                match lightningcss::css_modules::Pattern::parse(pattern) {
                  Ok(p) => p,
                  Err(e) => return Err(CompileError::PatternError(e)),
                }
              } else {
                Default::default()
              },
              dashed_idents: c.dashed_idents.unwrap_or_default(),
              animation: c.animation.unwrap_or(true),
              container: c.container.unwrap_or(true),
              grid: c.grid.unwrap_or(true),
              custom_idents: c.custom_idents.unwrap_or(true),
              pure: c.pure.unwrap_or_default(),
            }),
          }
        } else {
          None
        },
        source_index: 0,
        error_recovery: config.error_recovery.unwrap_or_default(),
        warnings: warnings.clone(),
      },
      &mut CustomAtRuleParser {
        configs: config.custom_at_rules.clone().unwrap_or_default(),
      },
    )?;

    #[cfg(feature = "visitor")]
    if let Some(visitor) = visitor.as_mut() {
      stylesheet.visit(visitor).map_err(CompileError::JsError)?;
    }

    let targets = Targets {
      browsers: config.targets,
      include: Features::from_bits_truncate(config.include),
      exclude: Features::from_bits_truncate(config.exclude),
    };

    stylesheet.minify(MinifyOptions {
      targets,
      unused_symbols: config.unused_symbols.clone().unwrap_or_default(),
    })?;

    stylesheet.to_css(PrinterOptions {
      minify: config.minify.unwrap_or_default(),
      source_map: source_map.as_mut(),
      project_root,
      targets,
      analyze_dependencies: if let Some(d) = &config.analyze_dependencies {
        match d {
          AnalyzeDependenciesOption::Bool(b) if *b => Some(DependencyOptions { remove_imports: true }),
          AnalyzeDependenciesOption::Config(c) => Some(DependencyOptions {
            remove_imports: !c.preserve_imports,
          }),
          _ => None,
        }
      } else {
        None
      },
      pseudo_classes: config.pseudo_classes.as_ref().map(|p| p.into()),
    })?
  };

  let map = if let Some(mut source_map) = source_map {
    if let Some(input_source_map) = &config.input_source_map {
      if let Ok(mut sm) = SourceMap::from_json("/", input_source_map) {
        let _ = source_map.extends(&mut sm);
      }
    }

    source_map.to_json(None).ok()
  } else {
    None
  };

  Ok(TransformResult {
    code: res.code.into_bytes(),
    map: map.map(|m| m.into_bytes()),
    exports: res.exports,
    references: res.references,
    dependencies: res.dependencies,
    warnings: warnings.map_or(Vec::new(), |w| {
      Arc::try_unwrap(w)
        .unwrap()
        .into_inner()
        .unwrap()
        .into_iter()
        .map(|w| w.into())
        .collect()
    }),
  })
}

#[cfg(feature = "bundler")]
fn compile_bundle<
  'i,
  'o,
  P: SourceProvider,
  F: FnOnce(&mut StyleSheet<'i, 'o, AtRule<'i>>) -> napi::Result<()>,
>(
  fs: &'i P,
  config: &'o BundleConfig,
  visit: Option<F>,
) -> Result<TransformResult<'i>, CompileError<'i, P::Error>> {
  use std::path::Path;

  let project_root = config.project_root.as_ref().map(|p| p.as_ref());
  let mut source_map = if config.source_map.unwrap_or_default() {
    Some(SourceMap::new(project_root.unwrap_or("/")))
  } else {
    None
  };
  let warnings = Some(Arc::new(RwLock::new(Vec::new())));

  let res = {
    let drafts = config.drafts.as_ref();
    let non_standard = config.non_standard.as_ref();
    let mut flags = ParserFlags::empty();
    flags.set(ParserFlags::CUSTOM_MEDIA, matches!(drafts, Some(d) if d.custom_media));
    flags.set(
      ParserFlags::DEEP_SELECTOR_COMBINATOR,
      matches!(non_standard, Some(v) if v.deep_selector_combinator),
    );

    let parser_options = ParserOptions {
      flags,
      css_modules: if let Some(css_modules) = &config.css_modules {
        match css_modules {
          CssModulesOption::Bool(true) => Some(lightningcss::css_modules::Config::default()),
          CssModulesOption::Bool(false) => None,
          CssModulesOption::Config(c) => Some(lightningcss::css_modules::Config {
            pattern: if let Some(pattern) = c.pattern.as_ref() {
              match lightningcss::css_modules::Pattern::parse(pattern) {
                Ok(p) => p,
                Err(e) => return Err(CompileError::PatternError(e)),
              }
            } else {
              Default::default()
            },
            dashed_idents: c.dashed_idents.unwrap_or_default(),
            animation: c.animation.unwrap_or(true),
            container: c.container.unwrap_or(true),
            grid: c.grid.unwrap_or(true),
            custom_idents: c.custom_idents.unwrap_or(true),
            pure: c.pure.unwrap_or_default(),
          }),
        }
      } else {
        None
      },
      error_recovery: config.error_recovery.unwrap_or_default(),
      warnings: warnings.clone(),
      filename: String::new(),
      source_index: 0,
    };

    let mut at_rule_parser = CustomAtRuleParser {
      configs: config.custom_at_rules.clone().unwrap_or_default(),
    };

    let mut bundler =
      Bundler::new_with_at_rule_parser(fs, source_map.as_mut(), parser_options, &mut at_rule_parser);
    let mut stylesheet = bundler.bundle(Path::new(&config.filename))?;

    if let Some(visit) = visit {
      visit(&mut stylesheet).map_err(CompileError::JsError)?;
    }

    let targets = Targets {
      browsers: config.targets,
      include: Features::from_bits_truncate(config.include),
      exclude: Features::from_bits_truncate(config.exclude),
    };

    stylesheet.minify(MinifyOptions {
      targets,
      unused_symbols: config.unused_symbols.clone().unwrap_or_default(),
    })?;

    stylesheet.to_css(PrinterOptions {
      minify: config.minify.unwrap_or_default(),
      source_map: source_map.as_mut(),
      project_root,
      targets,
      analyze_dependencies: if let Some(d) = &config.analyze_dependencies {
        match d {
          AnalyzeDependenciesOption::Bool(b) if *b => Some(DependencyOptions { remove_imports: true }),
          AnalyzeDependenciesOption::Config(c) => Some(DependencyOptions {
            remove_imports: !c.preserve_imports,
          }),
          _ => None,
        }
      } else {
        None
      },
      pseudo_classes: config.pseudo_classes.as_ref().map(|p| p.into()),
    })?
  };

  let map = if let Some(source_map) = &mut source_map {
    source_map.to_json(None).ok()
  } else {
    None
  };

  Ok(TransformResult {
    code: res.code.into_bytes(),
    map: map.map(|m| m.into_bytes()),
    exports: res.exports,
    references: res.references,
    dependencies: res.dependencies,
    warnings: warnings.map_or(Vec::new(), |w| {
      Arc::try_unwrap(w)
        .unwrap()
        .into_inner()
        .unwrap()
        .into_iter()
        .map(|w| w.into())
        .collect()
    }),
  })
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct AttrConfig {
  pub filename: Option<String>,
  #[serde(with = "serde_bytes")]
  pub code: Vec<u8>,
  pub targets: Option<Browsers>,
  #[serde(default)]
  pub include: u32,
  #[serde(default)]
  pub exclude: u32,
  #[serde(default)]
  pub minify: bool,
  #[serde(default)]
  pub analyze_dependencies: bool,
  #[serde(default)]
  pub error_recovery: bool,
}

#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct AttrResult<'i> {
  #[serde(with = "serde_bytes")]
  code: Vec<u8>,
  dependencies: Option<Vec<Dependency>>,
  warnings: Vec<Warning<'i>>,
}

impl<'i> AttrResult<'i> {
  fn into_js(self, ctx: CallContext) -> napi::Result<JsUnknown> {
    // Manually construct buffers so we avoid a copy and work around
    // https://github.com/napi-rs/napi-rs/issues/1124.
    let mut obj = ctx.env.create_object()?;
    let buf = ctx.env.create_buffer_with_data(self.code)?;
    obj.set_named_property("code", buf.into_raw())?;
    obj.set_named_property("dependencies", ctx.env.to_js_value(&self.dependencies)?)?;
    obj.set_named_property("warnings", ctx.env.to_js_value(&self.warnings)?)?;
    Ok(obj.into_unknown())
  }
}

fn compile_attr<'i>(
  code: &'i str,
  config: &AttrConfig,
  #[allow(unused_variables)] visitor: &mut Option<JsVisitor>,
) -> Result<AttrResult<'i>, CompileError<'i, napi::Error>> {
  let warnings = if config.error_recovery {
    Some(Arc::new(RwLock::new(Vec::new())))
  } else {
    None
  };
  let res = {
    let filename = config.filename.clone().unwrap_or_default();
    let mut attr = StyleAttribute::parse(
      &code,
      ParserOptions {
        filename,
        error_recovery: config.error_recovery,
        warnings: warnings.clone(),
        ..ParserOptions::default()
      },
    )?;

    #[cfg(feature = "visitor")]
    if let Some(visitor) = visitor.as_mut() {
      attr.visit(visitor).unwrap();
    }

    let targets = Targets {
      browsers: config.targets,
      include: Features::from_bits_truncate(config.include),
      exclude: Features::from_bits_truncate(config.exclude),
    };

    attr.minify(MinifyOptions {
      targets,
      ..MinifyOptions::default()
    });
    attr.to_css(PrinterOptions {
      minify: config.minify,
      source_map: None,
      project_root: None,
      targets,
      analyze_dependencies: if config.analyze_dependencies {
        Some(DependencyOptions::default())
      } else {
        None
      },
      pseudo_classes: None,
    })?
  };
  Ok(AttrResult {
    code: res.code.into_bytes(),
    dependencies: res.dependencies,
    warnings: warnings.map_or(Vec::new(), |w| {
      Arc::try_unwrap(w)
        .unwrap()
        .into_inner()
        .unwrap()
        .into_iter()
        .map(|w| w.into())
        .collect()
    }),
  })
}

enum CompileError<'i, E: std::error::Error> {
  ParseError(Error<ParserError<'i>>),
  MinifyError(Error<MinifyErrorKind>),
  PrinterError(Error<PrinterErrorKind>),
  SourceMapError(parcel_sourcemap::SourceMapError),
  BundleError(Error<BundleErrorKind<'i, E>>),
  PatternError(PatternParseError),
  #[cfg(feature = "visitor")]
  JsError(napi::Error),
}

impl<'i, E: std::error::Error> std::fmt::Display for CompileError<'i, E> {
  fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
    match self {
      CompileError::ParseError(err) => err.kind.fmt(f),
      CompileError::MinifyError(err) => err.kind.fmt(f),
      CompileError::PrinterError(err) => err.kind.fmt(f),
      CompileError::BundleError(err) => err.kind.fmt(f),
      CompileError::PatternError(err) => err.fmt(f),
      CompileError::SourceMapError(err) => write!(f, "{}", err.to_string()), // TODO: switch to `fmt::Display` once parcel_sourcemap supports this
      #[cfg(feature = "visitor")]
      CompileError::JsError(err) => std::fmt::Debug::fmt(&err, f),
    }
  }
}

impl<'i, E: IntoJsError + std::error::Error> CompileError<'i, E> {
  fn into_js_error(self, env: Env, code: Option<&str>) -> napi::Result<napi::Error> {
    let reason = self.to_string();
    let data = match &self {
      CompileError::ParseError(Error { kind, .. }) => env.to_js_value(kind)?,
      CompileError::PrinterError(Error { kind, .. }) => env.to_js_value(kind)?,
      CompileError::MinifyError(Error { kind, .. }) => env.to_js_value(kind)?,
      CompileError::BundleError(Error { kind, .. }) => env.to_js_value(kind)?,
      _ => env.get_null()?.into_unknown(),
    };

    let (js_error, loc) = match self {
      CompileError::BundleError(Error {
        loc,
        kind: BundleErrorKind::ResolverError(e),
      }) => {
        // Add location info to existing JS error if available.
        (e.into_js_error(env)?, loc)
      }
      CompileError::ParseError(Error { loc, .. })
      | CompileError::PrinterError(Error { loc, .. })
      | CompileError::MinifyError(Error { loc, .. })
      | CompileError::BundleError(Error { loc, .. }) => {
        // Generate an error with location information.
        let syntax_error = env.get_global()?.get_named_property::<napi::JsFunction>("SyntaxError")?;
        let reason = env.create_string_from_std(reason)?;
        let obj = syntax_error.new_instance(&[reason])?;
        (obj.into_unknown(), loc)
      }
      _ => return Ok(self.into()),
    };

    if js_error.get_type()? == napi::ValueType::Object {
      let mut obj: JsObject = unsafe { js_error.cast() };
      if let Some(loc) = loc {
        let line = env.create_int32((loc.line + 1) as i32)?;
        let col = env.create_int32(loc.column as i32)?;
        let filename = env.create_string_from_std(loc.filename)?;
        obj.set_named_property("fileName", filename)?;
        if let Some(code) = code {
          let source = env.create_string(code)?;
          obj.set_named_property("source", source)?;
        }
        let mut loc = env.create_object()?;
        loc.set_named_property("line", line)?;
        loc.set_named_property("column", col)?;
        obj.set_named_property("loc", loc)?;
      }
      obj.set_named_property("data", data)?;
      Ok(obj.into_unknown().into())
    } else {
      Ok(js_error.into())
    }
  }
}

trait IntoJsError {
  fn into_js_error(self, env: Env) -> napi::Result<JsUnknown>;
}

impl IntoJsError for std::io::Error {
  fn into_js_error(self, env: Env) -> napi::Result<JsUnknown> {
    let reason = self.to_string();
    let syntax_error = env.get_global()?.get_named_property::<napi::JsFunction>("SyntaxError")?;
    let reason = env.create_string_from_std(reason)?;
    let obj = syntax_error.new_instance(&[reason])?;
    Ok(obj.into_unknown())
  }
}

impl IntoJsError for napi::Error {
  fn into_js_error(self, env: Env) -> napi::Result<JsUnknown> {
    unsafe { JsUnknown::from_napi_value(env.raw(), ToNapiValue::to_napi_value(env.raw(), self)?) }
  }
}

impl<'i, E: std::error::Error> From<Error<ParserError<'i>>> for CompileError<'i, E> {
  fn from(e: Error<ParserError<'i>>) -> CompileError<'i, E> {
    CompileError::ParseError(e)
  }
}

impl<'i, E: std::error::Error> From<Error<MinifyErrorKind>> for CompileError<'i, E> {
  fn from(err: Error<MinifyErrorKind>) -> CompileError<'i, E> {
    CompileError::MinifyError(err)
  }
}

impl<'i, E: std::error::Error> From<Error<PrinterErrorKind>> for CompileError<'i, E> {
  fn from(err: Error<PrinterErrorKind>) -> CompileError<'i, E> {
    CompileError::PrinterError(err)
  }
}

impl<'i, E: std::error::Error> From<parcel_sourcemap::SourceMapError> for CompileError<'i, E> {
  fn from(e: parcel_sourcemap::SourceMapError) -> CompileError<'i, E> {
    CompileError::SourceMapError(e)
  }
}

impl<'i, E: std::error::Error> From<Error<BundleErrorKind<'i, E>>> for CompileError<'i, E> {
  fn from(e: Error<BundleErrorKind<'i, E>>) -> CompileError<'i, E> {
    CompileError::BundleError(e)
  }
}

impl<'i, E: std::error::Error> From<CompileError<'i, E>> for napi::Error {
  fn from(e: CompileError<'i, E>) -> napi::Error {
    match e {
      CompileError::SourceMapError(e) => napi::Error::from_reason(e.to_string()),
      CompileError::PatternError(e) => napi::Error::from_reason(e.to_string()),
      #[cfg(feature = "visitor")]
      CompileError::JsError(e) => e,
      _ => napi::Error::new(napi::Status::GenericFailure, e.to_string()),
    }
  }
}

#[derive(Serialize)]
struct Warning<'i> {
  message: String,
  #[serde(flatten)]
  data: ParserError<'i>,
  loc: Option<ErrorLocation>,
}

impl<'i> From<Error<ParserError<'i>>> for Warning<'i> {
  fn from(mut e: Error<ParserError<'i>>) -> Self {
    // Convert to 1-based line numbers.
    if let Some(loc) = &mut e.loc {
      loc.line += 1;
    }
    Warning {
      message: e.kind.to_string(),
      data: e.kind,
      loc: e.loc,
    }
  }
}


================================================
FILE: napi/src/threadsafe_function.rs
================================================
// Fork of threadsafe_function from napi-rs that allows calling JS function manually rather than
// only returning args. This enables us to use the return value of the function.

#![allow(clippy::single_component_path_imports)]

use std::convert::Into;
use std::ffi::CString;
use std::marker::PhantomData;
use std::os::raw::c_void;
use std::ptr;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;

use napi::{check_status, sys, Env, Result, Status};
use napi::{JsError, JsFunction, NapiValue};

/// ThreadSafeFunction Context object
/// the `value` is the value passed to `call` method
pub struct ThreadSafeCallContext<T: 'static> {
  pub env: Env,
  pub value: T,
  pub callback: Option<JsFunction>,
}

#[repr(u8)]
pub enum ThreadsafeFunctionCallMode {
  NonBlocking,
  Blocking,
}

impl From<ThreadsafeFunctionCallMode> for sys::napi_threadsafe_function_call_mode {
  fn from(value: ThreadsafeFunctionCallMode) -> Self {
    match value {
      ThreadsafeFunctionCallMode::Blocking => sys::ThreadsafeFunctionCallMode::blocking,
      ThreadsafeFunctionCallMode::NonBlocking => sys::ThreadsafeFunctionCallMode::nonblocking,
    }
  }
}

/// Communicate with the addon's main thread by invoking a JavaScript function from other threads.
///
/// ## Example
/// An example of using `ThreadsafeFunction`:
///
/// ```rust
/// #[macro_use]
/// extern crate napi_derive;
///
/// use std::thread;
///
/// use napi::{
///     threadsafe_function::{
///         ThreadSafeCallContext, ThreadsafeFunctionCallMode, ThreadsafeFunctionReleaseMode,
///     },
///     CallContext, Error, JsFunction, JsNumber, JsUndefined, Result, Status,
/// };
///
/// #[js_function(1)]
/// pub fn test_threadsafe_function(ctx: CallContext) -> Result<JsUndefined> {
///   let func = ctx.get::<JsFunction>(0)?;
///
///   let tsfn =
///       ctx
///           .env
///           .create_threadsafe_function(&func, 0, |ctx: ThreadSafeCallContext<Vec<u32>>| {
///             ctx.value
///                 .iter()
///                 .map(|v| ctx.env.create_uint32(*v))
///                 .collect::<Result<Vec<JsNumber>>>()
///           })?;
///
///   let tsfn_cloned = tsfn.clone();
///
///   thread::spawn(move || {
///       let output: Vec<u32> = vec![0, 1, 2, 3];
///       // It's okay to call a threadsafe function multiple times.
///       tsfn.call(Ok(output.clone()), ThreadsafeFunctionCallMode::Blocking);
///   });
///
///   thread::spawn(move || {
///       let output: Vec<u32> = vec![3, 2, 1, 0];
///       // It's okay to call a threadsafe function multiple times.
///       tsfn_cloned.call(Ok(output.clone()), ThreadsafeFunctionCallMode::NonBlocking);
///   });
///
///   ctx.env.get_undefined()
/// }
/// ```
pub struct ThreadsafeFunction<T: 'static> {
  raw_tsfn: sys::napi_threadsafe_function,
  aborted: Arc<AtomicBool>,
  ref_count: Arc<AtomicUsize>,
  _phantom: PhantomData<T>,
}

impl<T: 'static> Clone for ThreadsafeFunction<T> {
  fn clone(&self) -> Self {
    if !self.aborted.load(Ordering::Acquire) {
      let acquire_status = unsafe { sys::napi_acquire_threadsafe_function(self.raw_tsfn) };
      debug_assert!(
        acquire_status == sys::Status::napi_ok,
        "Acquire threadsafe function failed in clone"
      );
    }

    Self {
      raw_tsfn: self.raw_tsfn,
      aborted: Arc::clone(&self.aborted),
      ref_count: Arc::clone(&self.ref_count),
      _phantom: PhantomData,
    }
  }
}

unsafe impl<T> Send for ThreadsafeFunction<T> {}
unsafe impl<T> Sync for ThreadsafeFunction<T> {}

impl<T: 'static> ThreadsafeFunction<T> {
  /// See [napi_create_threadsafe_function](https://nodejs.org/api/n-api.html#n_api_napi_create_threadsafe_function)
  /// for more information.
  pub(crate) fn create<R: 'static + Send + FnMut(ThreadSafeCallContext<T>) -> Result<()>>(
    env: sys::napi_env,
    func: sys::napi_value,
    max_queue_size: usize,
    callback: R,
  ) -> Result<Self> {
    let mut async_resource_name = ptr::null_mut();
    let s = "napi_rs_threadsafe_function";
    let len = s.len();
    let s = CString::new(s)?;
    check_status!(unsafe { sys::napi_create_string_utf8(env, s.as_ptr(), len, &mut async_resource_name) })?;

    let initial_thread_count = 1usize;
    let mut raw_tsfn = ptr::null_mut();
    let ptr = Box::into_raw(Box::new(callback)) as *mut c_void;
    check_status!(unsafe {
      sys::napi_create_threadsafe_function(
        env,
        func,
        ptr::null_mut(),
        async_resource_name,
        max_queue_size,
        initial_thread_count,
        ptr,
        Some(thread_finalize_cb::<T, R>),
        ptr,
        Some(call_js_cb::<T, R>),
        &mut raw_tsfn,
      )
    })?;

    let aborted = Arc::new(AtomicBool::new(false));
    let aborted_ptr = Arc::into_raw(aborted.clone()) as *mut c_void;
    check_status!(unsafe { sys::napi_add_env_cleanup_hook(env, Some(cleanup_cb), aborted_ptr) })?;

    Ok(ThreadsafeFunction {
      raw_tsfn,
      aborted,
      ref_count: Arc::new(AtomicUsize::new(initial_thread_count)),
      _phantom: PhantomData,
    })
  }
}

impl<T: 'static> ThreadsafeFunction<T> {
  /// See [napi_call_threadsafe_function](https://nodejs.org/api/n-api.html#n_api_napi_call_threadsafe_function)
  /// for more information.
  pub fn call(&self, value: T, mode: ThreadsafeFunctionCallMode) -> Status {
    if self.aborted.load(Ordering::Acquire) {
      return Status::Closing;
    }
    unsafe {
      sys::napi_call_threadsafe_function(self.raw_tsfn, Box::into_raw(Box::new(value)) as *mut _, mode.into())
    }
    .into()
  }
}

impl<T: 'static> Drop for ThreadsafeFunction<T> {
  fn drop(&mut self) {
    if !self.aborted.load(Ordering::Acquire) && self.ref_count.load(Ordering::Acquire) > 0usize {
      let release_status = unsafe {
        sys::napi_release_threadsafe_function(self.raw_tsfn, sys::ThreadsafeFunctionReleaseMode::release)
      };
      assert!(
        release_status == sys::Status::napi_ok,
        "Threadsafe Function release failed"
      );
    }
  }
}

unsafe extern "C" fn cleanup_cb(cleanup_data: *mut c_void) {
  let aborted = Arc::<AtomicBool>::from_raw(cleanup_data.cast());
  aborted.store(true, Ordering::SeqCst);
}

unsafe extern "C" fn thread_finalize_cb<T: 'static, R>(
  _raw_env: sys::napi_env,
  finalize_data: *mut c_void,
  _finalize_hint: *mut c_void,
) where
  R: 'static + Send + FnMut(ThreadSafeCallContext<T>) -> Result<()>,
{
  // cleanup
  drop(Box::<R>::from_raw(finalize_data.cast()));
}

unsafe extern "C" fn call_js_cb<T: 'static, R>(
  raw_env: sys::napi_env,
  js_callback: sys::napi_value,
  context: *mut c_void,
  data: *mut c_void,
) where
  R: 'static + Send + FnMut(ThreadSafeCallContext<T>) -> Result<()>,
{
  // env and/or callback can be null when shutting down
  if raw_env.is_null() {
    return;
  }

  let ctx: &mut R = &mut *context.cast::<R>();
  let val: Result<T> = Ok(*Box::<T>::from_raw(data.cast()));

  let mut recv = ptr::null_mut();
  sys::napi_get_undefined(raw_env, &mut recv);

  let ret = val.and_then(|v| {
    (ctx)(ThreadSafeCallContext {
      env: Env::from_raw(raw_env),
      value: v,
      callback: if js_callback.is_null() {
        None
      } else {
        Some(JsFunction::from_raw(raw_env, js_callback).unwrap()) // TODO: unwrap
      },
    })
  });

  let status = match ret {
    Ok(()) => sys::Status::napi_ok,
    Err(e) => sys::napi_fatal_exception(raw_env, JsError::from(e).into_value(raw_env)),
  };
  if status == sys::Status::napi_ok {
    return;
  }
  if status == sys::Status::napi_pending_exception {
    let mut error_result = ptr::null_mut();
    assert_eq!(
      sys::napi_get_and_clear_last_exception(raw_env, &mut error_result),
      sys::Status::napi_ok
    );

    // When shutting down, napi_fatal_exception sometimes returns another exception
    let stat = sys::napi_fatal_exception(raw_env, error_result);
    assert!(stat == sys::Status::napi_ok || stat == sys::Status::napi_pending_exception);
  } else {
    let error_code: Status = status.into();
    let error_code_string = format!("{:?}", error_code);
    let mut error_code_value = ptr::null_mut();
    assert_eq!(
      sys::napi_create_string_utf8(
        raw_env,
        error_code_string.as_ptr() as *const _,
        error_code_string.len(),
        &mut error_code_value,
      ),
      sys::Status::napi_ok,
    );
    let error_msg = "Call JavaScript callback failed in thread safe function";
    let mut error_msg_value = ptr::null_mut();
    assert_eq!(
      sys::napi_create_string_utf8(
        raw_env,
        error_msg.as_ptr() as *const _,
        error_msg.len(),
        &mut error_msg_value,
      ),
      sys::Status::napi_ok,
    );
    let mut error_value = ptr::null_mut();
    assert_eq!(
      sys::napi_create_error(raw_env, error_code_value, error_msg_value, &mut error_value),
      sys::Status::napi_ok,
    );
    assert_eq!(sys::napi_fatal_exception(raw_env, error_value), sys::Status::napi_ok);
  }
}


================================================
FILE: napi/src/transformer.rs
================================================
use std::{
  marker::PhantomData,
  ops::{Index, IndexMut},
};

use lightningcss::{
  media_query::MediaFeatureValue,
  properties::{
    custom::{Token, TokenList, TokenOrValue},
    Property,
  },
  rules::{CssRule, CssRuleList},
  stylesheet::ParserOptions,
  traits::ParseWithOptions,
  values::{
    ident::Ident,
    length::{Length, LengthValue},
    string::CowArcStr,
  },
  visitor::{Visit, VisitTypes, Visitor},
};
use lightningcss::{stylesheet::StyleSheet, traits::IntoOwned};
use napi::{Env, JsFunction, JsObject, JsUnknown, Ref, ValueType};
use serde::{Deserialize, Serialize};
use smallvec::SmallVec;

use crate::{at_rule_parser::AtRule, utils::get_named_property};

pub struct JsVisitor {
  env: Env,
  visit_stylesheet: VisitorsRef,
  visit_rule: VisitorsRef,
  rule_map: VisitorsRef,
  property_map: VisitorsRef,
  visit_declaration: VisitorsRef,
  visit_length: Option<Ref<()>>,
  visit_angle: Option<Ref<()>>,
  visit_ratio: Option<Ref<()>>,
  visit_resolution: Option<Ref<()>>,
  visit_time: Option<Ref<()>>,
  visit_color: Option<Ref<()>>,
  visit_image: VisitorsRef,
  visit_url: Option<Ref<()>>,
  visit_media_query: VisitorsRef,
  visit_supports_condition: VisitorsRef,
  visit_custom_ident: Option<Ref<()>>,
  visit_dashed_ident: Option<Ref<()>>,
  visit_selector: Option<Ref<()>>,
  visit_token: VisitorsRef,
  token_map: VisitorsRef,
  visit_function: VisitorsRef,
  function_map: VisitorsRef,
  visit_variable: VisitorsRef,
  visit_env: VisitorsRef,
  env_map: VisitorsRef,
  types: VisitTypes,
}

// This is so that the visitor can work with bundleAsync.
// We ensure that we only call JsVisitor from the main JS thread.
unsafe impl Send for JsVisitor {}

#[derive(PartialEq, Eq, Clone, Copy)]
enum VisitStage {
  Enter,
  Exit,
}

type VisitorsRef = Visitors<Ref<()>>;

struct Visitors<T> {
  enter: Option<T>,
  exit: Option<T>,
}

impl<T> Visitors<T> {
  fn new(enter: Option<T>, exit: Option<T>) -> Self {
    Self { enter, exit }
  }

  fn for_stage(&self, stage: VisitStage) -> Option<&T> {
    match stage {
      VisitStage::Enter => self.enter.as_ref(),
      VisitStage::Exit => self.exit.as_ref(),
    }
  }
}

impl Visitors<Ref<()>> {
  fn get<U: napi::NapiValue>(&self, env: &Env) -> Visitors<U> {
    Visitors {
      enter: self.enter.as_ref().and_then(|p| env.get_reference_value_unchecked(p).ok()),
      exit: self.exit.as_ref().and_then(|p| env.get_reference_value_unchecked(p).ok()),
    }
  }
}

impl Visitors<JsObject> {
  fn named(&self, stage: VisitStage, name: &str) -> Option<JsFunction> {
    self
      .for_stage(stage)
      .and_then(|m| get_named_property::<JsFunction>(m, name).ok())
  }

  fn custom(&self, stage: VisitStage, obj: &str, name: &str) -> Option<JsFunction> {
    self
      .for_stage(stage)
      .and_then(|m| m.get_named_property::<JsUnknown>(obj).ok())
      .and_then(|v| {
        match v.get_type() {
          Ok(ValueType::Function) => return v.try_into().ok(),
          Ok(ValueType::Object) => {
            let o: napi::Result<JsObject> = v.try_into();
            if let Ok(o) = o {
              return get_named_property::<JsFunction>(&o, name).ok();
            }
          }
          _ => {}
        }

        None
      })
  }
}

impl Drop for JsVisitor {
  fn drop(&mut self) {
    macro_rules! drop {
      ($id: ident) => {
        if let Some(v) = &mut self.$id {
          drop(v.unref(self.env));
        }
      };
    }

    macro_rules! drop_tuple {
      ($id: ident) => {
        if let Some(v) = &mut self.$id.enter {
          drop(v.unref(self.env));
        }
        if let Some(v) = &mut self.$id.exit {
          drop(v.unref(self.env));
        }
      };
    }

    drop_tuple!(visit_stylesheet);
    drop_tuple!(visit_rule);
    drop_tuple!(rule_map);
    drop_tuple!(visit_declaration);
    drop_tuple!(property_map);
    drop!(visit_length);
    drop!(visit_angle);
    drop!(visit_ratio);
    drop!(visit_resolution);
    drop!(visit_time);
    drop!(visit_color);
    drop_tuple!(visit_image);
    drop!(visit_url);
    drop_tuple!(visit_media_query);
    drop_tuple!(visit_supports_condition);
    drop_tuple!(visit_variable);
    drop_tuple!(visit_env);
    drop_tuple!(env_map);
    drop!(visit_custom_ident);
    drop!(visit_dashed_ident);
    drop_tuple!(visit_function);
    drop_tuple!(function_map);
    drop!(visit_selector);
    drop_tuple!(visit_token);
    drop_tuple!(token_map);
  }
}

impl JsVisitor {
  pub fn new(env: Env, visitor: JsObject) -> Self {
    let mut types = VisitTypes::empty();
    macro_rules! get {
      ($name: literal, $( $t: ident )|+) => {{
        let res: Option<JsFunction> = get_named_property(&visitor, $name).ok();

        if res.is_some() {
          types |= $( VisitTypes::$t )|+;
        }

        // We must create a reference so that the garbage collector doesn't destroy
        // the function before we try to call it (in the async bundle case).
        res.and_then(|res| env.create_reference(res).ok())
      }};
    }

    macro_rules! map {
      ($name: literal, $( $t: ident )|+) => {{
        let obj: Option<JsObject> = get_named_property(&visitor, $name).ok();

        if obj.is_some() {
          types |= $( VisitTypes::$t )|+;
        }

        obj.and_then(|obj| env.create_reference(obj).ok())
      }};
    }

    Self {
      env,
      visit_stylesheet: VisitorsRef::new(get!("StyleSheet", RULES), get!("StyleSheetExit", RULES)),
      visit_rule: VisitorsRef::new(get!("Rule", RULES), get!("RuleExit", RULES)),
      rule_map: VisitorsRef::new(map!("Rule", RULES), get!("RuleExit", RULES)),
      visit_declaration: VisitorsRef::new(get!("Declaration", PROPERTIES), get!("DeclarationExit", PROPERTIES)),
      property_map: VisitorsRef::new(map!("Declaration", PROPERTIES), map!("DeclarationExit", PROPERTIES)),
      visit_length: get!("Length", LENGTHS),
      visit_angle: get!("Angle", ANGLES),
      visit_ratio: get!("Ratio", RATIOS),
      visit_resolution: get!("Resolution", RESOLUTIONS),
      visit_time: get!("Time", TIMES),
      visit_color: get!("Color", COLORS),
      visit_image: VisitorsRef::new(get!("Image", IMAGES), get!("ImageExit", IMAGES)),
      visit_url: get!("Url", URLS),
      visit_media_query: VisitorsRef::new(
        get!("MediaQuery", MEDIA_QUERIES),
        get!("MediaQueryExit", MEDIA_QUERIES),
      ),
      visit_supports_condition: VisitorsRef::new(
        get!("SupportsCondition", SUPPORTS_CONDITIONS),
        get!("SupportsConditionExit", SUPPORTS_CONDITIONS),
      ),
      visit_variable: VisitorsRef::new(get!("Variable", TOKENS), get!("VariableExit", TOKENS)),
      visit_env: VisitorsRef::new(
        get!("EnvironmentVariable", TOKENS | MEDIA_QUERIES | ENVIRONMENT_VARIABLES),
        get!(
          "EnvironmentVariableExit",
          TOKENS | MEDIA_QUERIES | ENVIRONMENT_VARIABLES
        ),
      ),
      env_map: VisitorsRef::new(
        map!("EnvironmentVariable", TOKENS | MEDIA_QUERIES | ENVIRONMENT_VARIABLES),
        map!(
          "EnvironmentVariableExit",
          TOKENS | MEDIA_QUERIES | ENVIRONMENT_VARIABLES
        ),
      ),
      visit_custom_ident: get!("CustomIdent", CUSTOM_IDENTS),
      visit_dashed_ident: get!("DashedIdent", DASHED_IDENTS),
      visit_function: VisitorsRef::new(get!("Function", TOKENS), get!("FunctionExit", TOKENS)),
      function_map: VisitorsRef::new(map!("Function", TOKENS), map!("FunctionExit", TOKENS)),
      visit_selector: get!("Selector", SELECTORS),
      visit_token: VisitorsRef::new(get!("Token", TOKENS), None),
      token_map: VisitorsRef::new(map!("Token", TOKENS), None),
      types,
    }
  }
}

impl<'i> Visitor<'i, AtRule<'i>> for JsVisitor {
  type Error = napi::Error;

  fn visit_types(&self) -> VisitTypes {
    self.types
  }

  fn visit_stylesheet<'o>(&mut self, stylesheet: &mut StyleSheet<'i, 'o, AtRule<'i>>) -> Result<(), Self::Error> {
    if self.types.contains(VisitTypes::RULES) {
      let env = self.env;
      let visit_stylesheet = self.visit_stylesheet.get::<JsFunction>(&env);
      if let Some(visit) = visit_stylesheet.for_stage(VisitStage::Enter) {
        call_visitor(&env, stylesheet, visit)?
      }

      stylesheet.visit_children(self)?;

      if let Some(visit) = visit_stylesheet.for_stage(VisitStage::Exit) {
        call_visitor(&env, stylesheet, visit)?
      }

      Ok(())
    } else {
      stylesheet.visit_children(self)
    }
  }

  fn visit_rule_list(
    &mut self,
    rules: &mut lightningcss::rules::CssRuleList<'i, AtRule<'i>>,
  ) -> Result<(), Self::Error> {
    if self.types.contains(VisitTypes::RULES) {
      let env = self.env;
      let rule_map = self.rule_map.get::<JsObject>(&env);
      let visit_rule = self.visit_rule.get::<JsFunction>(&env);

      visit_list(
        rules,
        |value, stage| {
          // Use a more specific visitor function if available, but fall back to visit_rule.
          let name = match value {
            CssRule::Media(..) => "media",
            CssRule::Import(..) => "import",
            CssRule::Style(..) => "style",
            CssRule::Keyframes(..) => "keyframes",
            CssRule::FontFace(..) => "font-face",
            CssRule::FontPaletteValues(..) => "font-palette-values",
            CssRule::FontFeatureValues(..) => "font-feature-values",
            CssRule::Page(..) => "page",
            CssRule::Supports(..) => "supports",
            CssRule::CounterStyle(..) => "counter-style",
            CssRule::Namespace(..) => "namespace",
            CssRule::CustomMedia(..) => "custom-media",
            CssRule::LayerBlock(..) => "layer-block",
            CssRule::LayerStatement(..) => "layer-statement",
            CssRule::Property(..) => "property",
            CssRule::Container(..) => "container",
            CssRule::Scope(..) => "scope",
            CssRule::MozDocument(..) => "moz-document",
            CssRule::Nesting(..) => "nesting",
            CssRule::NestedDeclarations(..) => "nested-declarations",
            CssRule::Viewport(..) => "viewport",
            CssRule::StartingStyle(..) => "starting-style",
            CssRule::ViewTransition(..) => "view-transition",
            CssRule::Unknown(v) => {
              let name = v.name.as_ref();
              if let Some(visit) = rule_map.custom(stage, "unknown", name) {
                let js_value = env.to_js_value(v)?;
                let res = visit.call(None, &[js_value])?;
                return env.from_js_value(res).map(serde_detach::detach);
              } else {
                "unknown"
              }
            }
            CssRule::Custom(c) => {
              let name = c.name.as_ref();
              if let Some(visit) = rule_map.custom(stage, "custom", name) {
                let js_value = env.to_js_value(c)?;
                let res = visit.call(None, &[js_value])?;
                return env.from_js_value(res).map(serde_detach::detach);
              } else {
                "custom"
              }
            }
            CssRule::Ignored => return Ok(None),
          };

          if let Some(visit) = rule_map.named(stage, name).as_ref().or(visit_rule.for_stage(stage)) {
            let js_value = env.to_js_value(value)?;
            let res = visit.call(None, &[js_value])?;
            env.from_js_value(res).map(serde_detach::detach)
          } else {
            Ok(None)
          }
        },
        |rule| rule.visit_children(self),
      )?;

      Ok(())
    } else {
      rules.visit_children(self)
    }
  }

  fn visit_declaration_block(
    &mut self,
    decls: &mut lightningcss::declaration::DeclarationBlock<'i>,
  ) -> Result<(), Self::Error> {
    if self.types.contains(VisitTypes::PROPERTIES) {
      let env = self.env;
      let property_map = self.property_map.get::<JsObject>(&env);
      let visit_declaration = self.visit_declaration.get::<JsFunction>(&env);
      visit_declaration_list(
        &env,
        &mut decls.important_declarations,
        &visit_declaration,
        &property_map,
        |property| property.visit_children(self),
      )?;
      visit_declaration_list(
        &env,
        &mut decls.declarations,
        &visit_declaration,
        &property_map,
        |property| property.visit_children(self),
      )?;
      Ok(())
    } else {
      decls.visit_children(self)
    }
  }

  fn visit_length(&mut self, length: &mut LengthValue) -> Result<(), Self::Error> {
    visit(&self.env, length, &self.visit_length)
  }

  fn visit_angle(&mut self, angle: &mut lightningcss::values::angle::Angle) -> Result<(), Self::Error> {
    visit(&self.env, angle, &self.visit_angle)
  }

  fn visit_ratio(&mut self, ratio: &mut lightningcss::values::ratio::Ratio) -> Result<(), Self::Error> {
    visit(&self.env, ratio, &self.visit_ratio)
  }

  fn visit_resolution(
    &mut self,
    resolution: &mut lightningcss::values::resolution::Resolution,
  ) -> Result<(), Self::Error> {
    visit(&self.env, resolution, &self.visit_resolution)
  }

  fn visit_time(&mut self, time: &mut lightningcss::values::time::Time) -> Result<(), Self::Error> {
    visit(&self.env, time, &self.visit_time)
  }

  fn visit_color(&mut self, color: &mut lightningcss::values::color::CssColor) -> Result<(), Self::Error> {
    visit(&self.env, color, &self.visit_color)
  }

  fn visit_image(&mut self, image: &mut lightningcss::values::image::Image<'i>) -> Result<(), Self::Error> {
    visit(&self.env, image, &self.visit_image.enter)?;
    image.visit_children(self)?;
    visit(&self.env, image, &self.visit_image.exit)
  }

  fn visit_url(&mut self, url: &mut lightningcss::values::url::Url<'i>) -> Result<(), Self::Error> {
    visit(&self.env, url, &self.visit_url)
  }

  fn visit_media_list(&mut self, media: &mut lightningcss::media_query::MediaList<'i>) -> Result<(), Self::Error> {
    if self.types.contains(VisitTypes::MEDIA_QUERIES) {
      let env = self.env;
      let visit_media_query = self.visit_media_query.get::<JsFunction>(&env);
      visit_list(
        &mut media.media_queries,
        |value, stage| {
          if let Some(visit) = visit_media_query.for_stage(stage) {
            let js_value = env.to_js_value(value)?;
            let res = visit.call(None, &[js_value])?;
            env.from_js_value(res).map(serde_detach::detach)
          } else {
            Ok(None)
          }
        },
        |q| q.visit_children(self),
      )?;
      Ok(())
    } else {
      media.visit_children(self)
    }
  }

  fn visit_media_feature_value(&mut self, value: &mut MediaFeatureValue<'i>) -> Result<(), Self::Error> {
    if self.types.contains(VisitTypes::ENVIRONMENT_VARIABLES) && matches!(value, MediaFeatureValue::Env(_)) {
      let env_map = self.env_map.get::<JsObject>(&self.env);
      let visit_env = self.visit_env.get::<JsFunction>(&self.env);
      let call = |stage: VisitStage, value: &mut MediaFeatureValue, env: &Env| -> napi::Result<()> {
        let env_var = if let MediaFeatureValue::Env(env) = value {
          env
        } else {
          return Ok(());
        };
        let visit_type = env_map.named(stage, env_var.name.name());
        let visit = visit_env.for_stage(stage);
        let new_value: Option<TokenOrValue> = if let Some(visit) = visit_type.as_ref().or(visit) {
          let js_value = env.to_js_value(env_var)?;
          let res = visit.call(None, &[js_value])?;
          env.from_js_value(res).map(serde_detach::detach)?
        } else {
          None
        };

        match new_value {
          None => return Ok(()),
          Some(TokenOrValue::Length(l)) => *value = MediaFeatureValue::Length(Length::Value(l)),
          Some(TokenOrValue::Resolution(r)) => *value = MediaFeatureValue::Resolution(r),
          Some(TokenOrValue::Token(Token::Number { value: n, .. })) => *value = MediaFeatureValue::Number(n),
          Some(TokenOrValue::Token(Token::Ident(ident))) => *value = MediaFeatureValue::Ident(Ident(ident)),
          // TODO: ratio
          _ => {
            return Err(napi::Error::new(
              napi::Status::InvalidArg,
              format!("invalid environment value in media query: {:?}", new_value),
            ))
          }
        }

        Ok(())
      };

      call(VisitStage::Enter, value, &self.env)?;
      value.visit_children(self)?;
      call(VisitStage::Exit, value, &self.env)?;
      return Ok(());
    }

    value.visit_children(self)
  }

  fn visit_supports_condition(
    &mut self,
    condition: &mut lightningcss::rules::supports::SupportsCondition<'i>,
  ) -> Result<(), Self::Error> {
    visit(&self.env, condition, &self.visit_supports_condition.enter)?;
    condition.visit_children(self)?;
    visit(&self.env, condition, &self.visit_supports_condition.exit)
  }

  fn visit_custom_ident(
    &mut self,
    ident: &mut lightningcss::values::ident::CustomIdent,
  ) -> Result<(), Self::Error> {
    visit(&self.env, ident, &self.visit_custom_ident)
  }

  fn visit_dashed_ident(
    &mut self,
    ident: &mut lightningcss::values::ident::DashedIdent,
  ) -> Result<(), Self::Error> {
    visit(&self.env, ident, &self.visit_dashed_ident)
  }

  fn visit_selector_list(
    &mut self,
    selectors: &mut lightningcss::selector::SelectorList<'i>,
  ) -> Result<(), Self::Error> {
    if let Some(visit) = self
      .visit_selector
      .as_ref()
      .and_then(|v| self.env.get_reference_value_unchecked::<JsFunction>(v).ok())
    {
      map::<_, _, _, true>(&mut selectors.0, |value| {
        let js_value = self.env.to_js_value(value)?;
        let res = visit.call(None, &[js_value])?;
        self.env.from_js_value(res).map(serde_detach::detach)
      })?;
    }

    Ok(())
  }

  fn visit_token_list(
    &mut self,
    tokens: &mut lightningcss::properties::custom::TokenList<'i>,
  ) -> Result<(), Self::Error> {
    if self.types.contains(VisitTypes::TOKENS) {
      let env = self.env;
      let visit_token = self.visit_token.get::<JsFunction>(&env);
      let token_map = self.token_map.get::<JsObject>(&env);
      let visit_function = self.visit_function.get::<JsFunction>(&env);
      let function_map = self.function_map.get::<JsObject>(&env);
      let visit_variable = self.visit_variable.get::<JsFunction>(&env);
      let visit_env = self.visit_env.get::<JsFunction>(&env);
      let env_map = self.env_map.get::<JsObject>(&env);

      visit_list(
        &mut tokens.0,
        |value, stage| {
          let (visit_type, visit) = match value {
            TokenOrValue::Function(f) => (
              function_map.named(stage, f.name.0.as_ref()),
              visit_function.for_stage(stage),
            ),
            TokenOrValue::Var(_) => (None, visit_variable.for_stage(stage)),
            TokenOrValue::Env(e) => (env_map.named(stage, e.name.name()), visit_env.for_stage(stage)),
            TokenOrValue::Token(t) => {
              let name = match t {
                Token::Ident(_) => Some("ident"),
                Token::AtKeyword(_) => Some("at-keyword"),
                Token::Hash(_) => Some("hash"),
                Token::IDHash(_) => Some("id-hash"),
                Token::String(_) => Some("string"),
                Token::Number { .. } => Some("number"),
                Token::Percentage { .. } => Some("percentage"),
                Token::Dimension { .. } => Some("dimension"),
                _ => None,
              };
              let visit = if let Some(name) = name {
                token_map.named(stage, name)
              } else {
                None
              };
              (visit, visit_token.for_stage(stage))
            }
            _ => return Ok(None),
          };

          if let Some(visit) = visit_type.as_ref().or(visit) {
            let js_value = match value {
              TokenOrValue::Function(f) => env.to_js_value(f)?,
              TokenOrValue::Var(v) => env.to_js_value(v)?,
              TokenOrValue::Env(v) => env.to_js_value(v)?,
              TokenOrValue::Token(t) => env.to_js_value(t)?,
              _ => unreachable!(),
            };

            let res = visit.call(None, &[js_value])?;
            let res: Option<TokensOrRaw> = env.from_js_value(res).map(serde_detach::detach)?;
            Ok(res.map(|r| r.0))
          } else {
            Ok(None)
          }
        },
        |value| value.visit_children(self),
      )?;

      Ok(())
    } else {
      tokens.visit_children(self)
    }
  }
}

fn visit<V: Serialize + Deserialize<'static>>(
  env: &Env,
  value: &mut V,
  visit: &Option<Ref<()>>,
) -> napi::Result<()> {
  if let Some(visit) = visit
    .as_ref()
    .and_then(|v| env.get_reference_value_unchecked::<JsFunction>(v).ok())
  {
    call_visitor(env, value, &visit)?;
  }

  Ok(())
}

fn call_visitor<V: Serialize + Deserialize<'static>>(
  env: &Env,
  value: &mut V,
  visit: &JsFunction,
) -> napi::Result<()> {
  let js_value = env.to_js_value(value)?;
  let res = visit.call(None, &[js_value])?;
  let new_value: Option<V> = env.from_js_value(res).map(serde_detach::detach)?;
  match new_value {
    Some(new_value) => *value = new_value,
    None => {}
  }

  Ok(())
}

fn visit_declaration_list<'i, C: FnMut(&mut Property<'i>) -> napi::Result<()>>(
  env: &Env,
  list: &mut Vec<Property<'i>>,
  visit_declaration: &Visitors<JsFunction>,
  property_map: &Visitors<JsObject>,
  visit_children: C,
) -> napi::Result<()> {
  visit_list(
    list,
    |value, stage| {
      // Use a specific property visitor if available, or fall back to Property visitor.
      let visit = match value {
        Property::Custom(v) => {
          if let Some(visit) = property_map.custom(stage, "custom", v.name.as_ref()) {
            let js_value = env.to_js_value(v)?;
            let res = visit.call(None, &[js_value])?;
            return env.from_js_value(res).map(serde_detach::detach);
          } else {
            None
          }
        }
        _ => property_map.named(stage, value.property_id().name()),
      };

      if let Some(visit) = visit.as_ref().or(visit_declaration.for_stage(stage)) {
        let js_value = env.to_js_value(value)?;
        let res = visit.call(None, &[js_value])?;
        env.from_js_value(res).map(serde_detach::detach)
      } else {
        Ok(None)
      }
    },
    visit_children,
  )
}

fn visit_list<
  V,
  L: List<V>,
  F: Fn(&mut V, VisitStage) -> napi::Result<Option<ValueOrVec<V>>>,
  C: FnMut(&mut V) -> napi::Result<()>,
>(
  list: &mut L,
  visit: F,
  mut visit_children: C,
) -> napi::Result<()> {
  map(list, |value| {
    let mut new_value: Option<ValueOrVec<V>> = visit(value, VisitStage::Enter)?;

    match &mut new_value {
      Some(ValueOrVec::Value(v)) => {
        visit_children(v)?;

        if let Some(val) = visit(v, VisitStage::Exit)? {
          new_value = Some(val);
        }
      }
      Some(ValueOrVec::Vec(v)) => {
        map(v, |value| {
          visit_children(value)?;
          visit(value, VisitStage::Exit)
        })?;
      }
      None => {
        visit_children(value)?;
        if let Some(val) = visit(value, VisitStage::Exit)? {
          new_value = Some(val);
        }
      }
    }

    Ok(new_value)
  })
}

fn map<V, L: List<V>, F: FnMut(&mut V) -> napi::Result<Option<ValueOrVec<V, IS_VEC>>>, const IS_VEC: bool>(
  list: &mut L,
  mut f: F,
) -> napi::Result<()> {
  let mut i = 0;
  while i < list.len() {
    let value = &mut list[i];
    let new_value = f(value)?;
    match new_value {
      Some(ValueOrVec::Value(v)) => {
        list[i] = v;
        i += 1;
      }
      Some(ValueOrVec::Vec(vec)) => {
        if vec.is_empty() {
          list.remove(i);
        } else {
          let len = vec.len();
          list.replace(i, vec);
          i += len;
        }
      }
      None => {
        i += 1;
      }
    }
  }
  Ok(())
}

#[derive(serde::Serialize)]
#[serde(untagged)]
enum ValueOrVec<V, const IS_VEC: bool = false> {
  Value(V),
  Vec(Vec<V>),
}

// Manually implemented deserialize for better error messages.
// https://github.com/serde-rs/serde/issues/773
impl<'de, V: serde::Deserialize<'de>, const IS_VEC: bool> serde::Deserialize<'de> for ValueOrVec<V, IS_VEC> {
  fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  where
    D: serde::Deserializer<'de>,
  {
    use serde::Deserializer;
    let content = serde_content::Value::deserialize(deserializer)?;
    let de = serde_content::Deserializer::new(content.clone()).coerce_numbers();

    // Try to deserialize as a sequence first.
    let mut was_seq = false;
    let res = de.deserialize_seq(SeqVisitor {
      was_seq: &mut was_seq,
      phantom: PhantomData,
    });

    if was_seq {
      // Allow fallback if we know the value is also a list (e.g. selector).
      if res.is_ok() || !IS_VEC {
        return res.map_err(|e| serde::de::Error::custom(e.to_string())).map(ValueOrVec::Vec);
      }
    }

    // If it wasn't a sequence, try a value.
    let de = serde_content::Deserializer::new(content).coerce_numbers();
    return V::deserialize(de)
      .map_err(|e| serde::de::Error::custom(e.to_string()))
      .map(ValueOrVec::Value);

    struct SeqVisitor<'a, V> {
      was_seq: &'a mut bool,
      phantom: PhantomData<V>,
    }

    impl<'a, 'de, V: serde::Deserialize<'de>> serde::de::Visitor<'de> for SeqVisitor<'a, V> {
      type Value = Vec<V>;

      fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
        formatter.write_str("a sequence")
      }

      fn visit_seq<A>(self, mut seq: A) -> Result<Self::Value, A::Error>
      where
        A: serde::de::SeqAccess<'de>,
      {
        *self.was_seq = true;
        let mut vec = Vec::with_capacity(seq.size_hint().unwrap_or(1));
        while let Some(v) = seq.next_element()? {
          vec.push(v);
        }
        Ok(vec)
      }
    }
  }
}

struct TokensOrRaw<'i>(ValueOrVec<TokenOrValue<'i>>);

impl<'i, 'de: 'i> serde::Deserialize<'de> for TokensOrRaw<'i> {
  fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  where
    D: serde::Deserializer<'de>,
  {
    #[derive(serde::Deserialize)]
    struct Raw<'i> {
      #[serde(borrow)]
      raw: CowArcStr<'i>,
    }

    let content = serde_content::Value::deserialize(deserializer)?;
    let de = serde_content::Deserializer::new(content.clone()).coerce_numbers();

    if let Ok(res) = Raw::deserialize(de) {
      let res = TokenList::parse_string_with_options(res.raw.as_ref(), ParserOptions::default())
        .map_err(|_| serde::de::Error::custom("Could not parse value"))?;
      return Ok(TokensOrRaw(ValueOrVec::Vec(res.into_owned().0)));
    }

    let de = serde_content::Deserializer::new(content).coerce_numbers();
    Ok(TokensOrRaw(
      ValueOrVec::deserialize(de).map_err(|e| serde::de::Error::custom(e.to_string()))?,
    ))
  }
}

trait List<V>: Index<usize, Output = V> + IndexMut<usize, Output = V> {
  fn len(&self) -> usize;
  fn remove(&mut self, i: usize);
  fn replace(&mut self, i: usize, items: Vec<V>);
}

impl<V> List<V> for Vec<V> {
  fn len(&self) -> usize {
    Vec::len(self)
  }

  fn remove(&mut self, i: usize) {
    Vec::remove(self, i);
  }

  fn replace(&mut self, i: usize, items: Vec<V>) {
    self.splice(i..i + 1, items);
  }
}

impl<V, T: smallvec::Array<Item = V>> List<V> for SmallVec<T> {
  fn len(&self) -> usize {
    SmallVec::len(self)
  }

  fn remove(&mut self, i: usize) {
    SmallVec::remove(self, i);
  }

  fn replace(&mut self, i: usize, items: Vec<V>) {
    let len = items.len();
    let mut iter = items.into_iter();
    self[i] = iter.next().unwrap();
    if len > 1 {
      self.insert_many(i + 1, iter);
    }
  }
}

impl<'i, R> List<CssRule<'i, R>> for CssRuleList<'i, R> {
  fn len(&self) -> usize {
    self.0.len()
  }

  fn remove(&mut self, i: usize) {
    self[i] = CssRule::Ignored;
  }

  fn replace(&mut self, i: usize, items: Vec<CssRule<'i, R>>) {
    self.0.replace(i, items)
  }
}


================================================
FILE: napi/src/utils.rs
================================================
use napi::{Error, JsObject, JsUnknown, Result};

// Workaround for https://github.com/napi-rs/napi-rs/issues/1641
pub fn get_named_property<T: TryFrom<JsUnknown, Error = Error>>(obj: &JsObject, property: &str) -> Result<T> {
  let unknown = obj.get_named_property::<JsUnknown>(property)?;
  T::try_from(unknown)
}


================================================
FILE: node/Cargo.toml
================================================
[package]
authors = ["Devon Govett <devongovett@gmail.com>"]
name = "lightningcss_node"
version = "0.1.0"
edition = "2021"
publish = false

[lib]
crate-type = ["cdylib"]

[dependencies]
lightningcss-napi = { version = "0.4.8", path = "../napi", features = [
  "bundler",
  "visitor",
] }
napi = { version = "2.15.4", default-features = false, features = [
  "compat-mode",
] }
napi-derive = "2"

[target.'cfg(target_os = "macos")'.dependencies]
jemallocator = { version = "0.3.2", features = ["disable_initial_exec_tls"] }

[target.'cfg(not(target_arch = "wasm32"))'.build-dependencies]
napi-build = "1"


================================================
FILE: node/ast.d.ts
================================================
/* eslint-disable */
/**
 * This file was automatically generated by json-schema-to-typescript.
 * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
 * and run json-schema-to-typescript to regenerate this file.
 */

export type String = string;
/**
 * A CSS rule.
 */
export type Rule<D = Declaration, M = MediaQuery> = | {
    type: "media";
    value: MediaRule<D, M>;
  }
| {
    type: "import";
    value: ImportRule<M>;
  }
| {
    type: "style";
    value: StyleRule<D, M>;
  }
| {
    type: "keyframes";
    value: KeyframesRule<D>;
  }
| {
    type: "font-face";
    value: FontFaceRule;
  }
| {
    type: "font-palette-values";
    value: FontPaletteValuesRule;
  }
| {
    type: "font-feature-values";
    value: FontFeatureValuesRule;
  }
| {
    type: "page";
    value: PageRule<D>;
  }
| {
    type: "supports";
    value: SupportsRule<D, M>;
  }
| {
    type: "counter-style";
    value: CounterStyleRule<D>;
  }
| {
    type: "namespace";
    value: NamespaceRule;
  }
| {
    type: "moz-document";
    value: MozDocumentRule<D, M>;
  }
| {
    type: "nesting";
    value: NestingRule<D, M>;
  }
| {
    type: "nested-declarations";
    value: NestedDeclarationsRule<D>;
  }
| {
    type: "viewport";
    value: ViewportRule<D>;
  }
| {
    type: "custom-media";
    value: CustomMediaRule<M>;
  }
| {
    type: "layer-statement";
    value: LayerStatementRule;
  }
| {
    type: "layer-block";
    value: LayerBlockRule<D, M>;
  }
| {
    type: "property";
    value: PropertyRule;
  }
| {
    type: "container";
    value: ContainerRule<D, M>;
  }
| {
    type: "scope";
    value: ScopeRule<D, M>;
  }
| {
    type: "starting-style";
    value: StartingStyleRule<D, M>;
  }
| {
    type: "view-transition";
    value: ViewTransitionRule;
  }
| {
    type: "ignored";
  }
| {
    type: "unknown";
    value: UnknownAtRule;
  }
| {
    type: "custom";
    value: DefaultAtRule;
  };
/**
 * Represents a media condition.
 */
export type MediaCondition =
  | {
      type: "feature";
      value: QueryFeatureFor_MediaFeatureId;
    }
  | {
      type: "not";
      value: MediaCondition;
    }
  | {
      /**
       * The conditions for the operator.
       */
      conditions: MediaCondition[];
      /**
       * The operator for the conditions.
       */
      operator: Operator;
      type: "operation";
    }
  | {
      type: "unknown";
      value: TokenOrValue[];
    };
/**
 * A generic media feature or container feature.
 */
export type QueryFeatureFor_MediaFeatureId =
  | {
      /**
       * The name of the feature.
       */
      name: MediaFeatureNameFor_MediaFeatureId;
      type: "plain";
      /**
       * The feature value.
       */
      value: MediaFeatureValue;
    }
  | {
      /**
       * The name of the feature.
       */
      name: MediaFeatureNameFor_MediaFeatureId;
      type: "boolean";
    }
  | {
      /**
       * The name of the feature.
       */
      name: MediaFeatureNameFor_MediaFeatureId;
      /**
       * A comparator.
       */
      operator: MediaFeatureComparison;
      type: "range";
      /**
       * The feature value.
       */
      value: MediaFeatureValue;
    }
  | {
      /**
       * The end value.
       */
      end: MediaFeatureValue;
      /**
       * A comparator for the end value.
       */
      endOperator: MediaFeatureComparison;
      /**
       * The name of the feature.
       */
      name: MediaFeatureNameFor_MediaFeatureId;
      /**
       * A start value.
       */
      start: MediaFeatureValue;
      /**
       * A comparator for the start value.
       */
      startOperator: MediaFeatureComparison;
      type: "interval";
    };
/**
 * A media feature name.
 */
export type MediaFeatureNameFor_MediaFeatureId = MediaFeatureId | String | String;
/**
 * A media query feature identifier.
 */
export type MediaFeatureId =
  | "width"
  | "height"
  | "aspect-ratio"
  | "orientation"
  | "overflow-block"
  | "overflow-inline"
  | "horizontal-viewport-segments"
  | "vertical-viewport-segments"
  | "display-mode"
  | "resolution"
  | "scan"
  | "grid"
  | "update"
  | "environment-blending"
  | "color"
  | "color-index"
  | "monochrome"
  | "color-gamut"
  | "dynamic-range"
  | "inverted-colors"
  | "pointer"
  | "hover"
  | "any-pointer"
  | "any-hover"
  | "nav-controls"
  | "video-color-gamut"
  | "video-dynamic-range"
  | "scripting"
  | "prefers-reduced-motion"
  | "prefers-reduced-transparency"
  | "prefers-contrast"
  | "forced-colors"
  | "prefers-color-scheme"
  | "prefers-reduced-data"
  | "device-width"
  | "device-height"
  | "device-aspect-ratio"
  | "-webkit-device-pixel-ratio"
  | "-moz-device-pixel-ratio";
/**
 * [media feature value](https://drafts.csswg.org/mediaqueries/#typedef-mf-value) within a media query.
 *
 * See [MediaFeature](MediaFeature).
 */
export type MediaFeatureValue =
  | {
      type: "length";
      value: Length;
    }
  | {
      type: "number";
      value: number;
    }
  | {
      type: "integer";
      value: number;
    }
  | {
      type: "boolean";
      value: boolean;
    }
  | {
      type: "resolution";
      value: Resolution;
    }
  | {
      type: "ratio";
      value: Ratio;
    }
  | {
      type: "ident";
      value: String;
    }
  | {
      type: "env";
      value: EnvironmentVariable;
    };
/**
 * A CSS [`<length>`](https://www.w3.org/TR/css-values-4/#lengths) value, with support for `calc()`.
 */
export type Length =
  | {
      type: "value";
      value: LengthValue;
    }
  | {
      type: "calc";
      value: CalcFor_Length;
    };
export type LengthUnit =
  | "px"
  | "in"
  | "cm"
  | "mm"
  | "q"
  | "pt"
  | "pc"
  | "em"
  | "rem"
  | "ex"
  | "rex"
  | "ch"
  | "rch"
  | "cap"
  | "rcap"
  | "ic"
  | "ric"
  | "lh"
  | "rlh"
  | "vw"
  | "lvw"
  | "svw"
  | "dvw"
  | "cqw"
  | "vh"
  | "lvh"
  | "svh"
  | "dvh"
  | "cqh"
  | "vi"
  | "svi"
  | "lvi"
  | "dvi"
  | "cqi"
  | "vb"
  | "svb"
  | "lvb"
  | "dvb"
  | "cqb"
  | "vmin"
  | "svmin"
  | "lvmin"
  | "dvmin"
  | "cqmin"
  | "vmax"
  | "svmax"
  | "lvmax"
  | "dvmax"
  | "cqmax";
/**
 * A mathematical expression used within the [`calc()`](https://www.w3.org/TR/css-values-4/#calc-func) function.
 *
 * This type supports generic value types. Values such as [Length](super::length::Length), [Percentage](super::percentage::Percentage), [Time](super::time::Time), and [Angle](super::angle::Angle) support `calc()` expressions.
 */
export type CalcFor_Length =
  | {
      type: "value";
      value: Length;
    }
  | {
      type: "number";
      value: number;
    }
  | {
      type: "sum";
      /**
       * @minItems 2
       * @maxItems 2
       */
      value: [CalcFor_Length, CalcFor_Length];
    }
  | {
      type: "product";
      /**
       * @minItems 2
       * @maxItems 2
       */
      value: [number, CalcFor_Length];
    }
  | {
      type: "function";
      value: MathFunctionFor_Length;
    };
/**
 * A CSS [math function](https://www.w3.org/TR/css-values-4/#math-function).
 *
 * Math functions may be used in most properties and values that accept numeric values, including lengths, percentages, angles, times, etc.
 */
export type MathFunctionFor_Length =
  | {
      type: "calc";
      value: CalcFor_Length;
    }
  | {
      type: "min";
      value: CalcFor_Length[];
    }
  | {
      type: "max";
      value: CalcFor_Length[];
    }
  | {
      type: "clamp";
      /**
       * @minItems 3
       * @maxItems 3
       */
      value: [CalcFor_Length, CalcFor_Length, CalcFor_Length];
    }
  | {
      type: "round";
      /**
       * @minItems 3
       * @maxItems 3
       */
      value: [RoundingStrategy, CalcFor_Length, CalcFor_Length];
    }
  | {
      type: "rem";
      /**
       * @minItems 2
       * @maxItems 2
       */
      value: [CalcFor_Length, CalcFor_Length];
    }
  | {
      type: "mod";
      /**
       * @minItems 2
       * @maxItems 2
       */
      value: [CalcFor_Length, CalcFor_Length];
    }
  | {
      type: "abs";
      value: CalcFor_Length;
    }
  | {
      type: "sign";
      value: CalcFor_Length;
    }
  | {
      type: "hypot";
      value: CalcFor_Length[];
    };
/**
 * A [rounding strategy](https://www.w3.org/TR/css-values-4/#typedef-rounding-strategy), as used in the `round()` function.
 */
export type RoundingStrategy = "nearest" | "up" | "down" | "to-zero";
/**
 * A CSS [`<resolution>`](https://www.w3.org/TR/css-values-4/#resolution) value.
 */
export type Resolution =
  | {
      type: "dpi";
      value: number;
    }
  | {
      type: "dpcm";
      value: number;
    }
  | {
      type: "dppx";
      value: number;
    };
/**
 * A CSS [`<ratio>`](https://www.w3.org/TR/css-values-4/#ratios) value, representing the ratio of two numeric values.
 *
 * @minItems 2
 * @maxItems 2
 */
export type Ratio = [number, number];
/**
 * A raw CSS token, or a parsed value.
 */
export type TokenOrValue =
  | {
      type: "token";
      value: Token;
    }
  | {
      type: "color";
      value: CssColor;
    }
  | {
      type: "unresolved-color";
      value: UnresolvedColor;
    }
  | {
      type: "url";
      value: Url;
    }
  | {
      type: "var";
      value: Variable;
    }
  | {
      type: "env";
      value: EnvironmentVariable;
    }
  | {
      type: "function";
      value: Function;
    }
  | {
      type: "length";
      value: LengthValue;
    }
  | {
      type: "angle";
      value: Angle;
    }
  | {
      type: "time";
      value: Time;
    }
  | {
      type: "resolution";
      value: Resolution;
    }
  | {
      type: "dashed-ident";
      value: String;
    }
  | {
      type: "animation-name";
      value: AnimationName;
    };
/**
 * A raw CSS token.
 */
export type Token =
  | {
      type: "ident";
      value: String;
    }
  | {
      type: "at-keyword";
      value: String;
    }
  | {
      type: "hash";
      value: String;
    }
  | {
      type: "id-hash";
      value: String;
    }
  | {
      type: "string";
      value: String;
    }
  | {
      type: "unquoted-url";
      value: String;
    }
  | {
      type: "delim";
      value: string;
    }
  | {
      type: "number";
      /**
       * The value as a float
       */
      value: number;
    }
  | {
      type: "percentage";
      /**
       * The value as a float, divided by 100 so that the nominal range is 0.0 to 1.0.
       */
      value: number;
    }
  | {
      type: "dimension";
      /**
       * The unit, e.g. "px" in `12px`
       */
      unit: String;
      /**
       * The value as a float
       */
      value: number;
    }
  | {
      type: "white-space";
      value: String;
    }
  | {
      type: "comment";
      value: String;
    }
  | {
      type: "colon";
    }
  | {
      type: "semicolon";
    }
  | {
      type: "comma";
    }
  | {
      type: "include-match";
    }
  | {
      type: "dash-match";
    }
  | {
      type: "prefix-match";
    }
  | {
      type: "suffix-match";
    }
  | {
      type: "substring-match";
    }
  | {
      type: "cdo";
    }
  | {
      type: "cdc";
    }
  | {
      type: "function";
      value: String;
    }
  | {
      type: "parenthesis-block";
    }
  | {
      type: "square-bracket-block";
    }
  | {
      type: "curly-bracket-block";
    }
  | {
      type: "bad-url";
      value: String;
    }
  | {
      type: "bad-string";
      value: String;
    }
  | {
      type: "close-parenthesis";
    }
  | {
      type: "close-square-bracket";
    }
  | {
      type: "close-curly-bracket";
    };
/**
 * A CSS [`<color>`](https://www.w3.org/TR/css-color-4/#color-type) value.
 *
 * CSS supports many different color spaces to represent colors. The most common values are stored as RGBA using a single byte per component. Less common values are stored using a `Box` to reduce the amount of memory used per color.
 *
 * Each color space is represented as a struct that implements the `From` and `Into` traits for all other color spaces, so it is possible to convert between color spaces easily. In addition, colors support [interpolation](#method.interpolate) as in the `color-mix()` function.
 */
export type CssColor = CurrentColor | RGBColor | LABColor | PredefinedColor | FloatColor | LightDark | SystemColor;
export type CurrentColor = {
  type: "currentcolor";
};
export type RGBColor = {
  /**
   * The alpha component.
   */
  alpha: number;
  /**
   * The blue component.
   */
  b: number;
  /**
   * The green component.
   */
  g: number;
  /**
   * The red component.
   */
  r: number;
  type: "rgb";
};
/**
 * A color in a LAB color space, including the `lab()`, `lch()`, `oklab()`, and `oklch()` functions.
 */
export type LABColor =
  | {
      /**
       * The a component.
       */
      a: number;
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The b component.
       */
      b: number;
      /**
       * The lightness component.
       */
      l: number;
      type: "lab";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The chroma component.
       */
      c: number;
      /**
       * The hue component.
       */
      h: number;
      /**
       * The lightness component.
       */
      l: number;
      type: "lch";
    }
  | {
      /**
       * The a component.
       */
      a: number;
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The b component.
       */
      b: number;
      /**
       * The lightness component.
       */
      l: number;
      type: "oklab";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The chroma component.
       */
      c: number;
      /**
       * The hue component.
       */
      h: number;
      /**
       * The lightness component.
       */
      l: number;
      type: "oklch";
    };
/**
 * A color in a predefined color space, e.g. `display-p3`.
 */
export type PredefinedColor =
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "srgb";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "srgb-linear";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "display-p3";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "a98-rgb";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "prophoto-rgb";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "rec2020";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      type: "xyz-d50";
      /**
       * The x component.
       */
      x: number;
      /**
       * The y component.
       */
      y: number;
      /**
       * The z component.
       */
      z: number;
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      type: "xyz-d65";
      /**
       * The x component.
       */
      x: number;
      /**
       * The y component.
       */
      y: number;
      /**
       * The z component.
       */
      z: number;
    };
/**
 * A floating point representation of color types that are usually stored as RGBA. These are used when there are any `none` components, which are represented as NaN.
 */
export type FloatColor =
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blue component.
       */
      b: number;
      /**
       * The green component.
       */
      g: number;
      /**
       * The red component.
       */
      r: number;
      type: "rgb";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The hue component.
       */
      h: number;
      /**
       * The lightness component.
       */
      l: number;
      /**
       * The saturation component.
       */
      s: number;
      type: "hsl";
    }
  | {
      /**
       * The alpha component.
       */
      alpha: number;
      /**
       * The blackness component.
       */
      b: number;
      /**
       * The hue component.
       */
      h: number;
      type: "hwb";
      /**
       * The whiteness component.
       */
      w: number;
    };
export type LightDark = {
  dark: CssColor;
  light: CssColor;
  type: "light-dark";
};
/**
 * A CSS [system color](https://drafts.csswg.org/css-color/#css-system-colors) keyword.
 */
export type SystemColor =
  | "accentcolor"
  | "accentcolortext"
  | "activetext"
  | "buttonborder"
  | "but
Download .txt
gitextract_yxy6uf4y/

├── .cargo/
│   └── config.toml
├── .github/
│   └── workflows/
│       ├── release-crates.yml
│       ├── release.yml
│       └── test.yml
├── .gitignore
├── .prettierrc
├── CONTRIBUTING.md
├── Cargo.toml
├── LICENSE
├── README.md
├── bench.js
├── c/
│   ├── Cargo.toml
│   ├── build.rs
│   ├── cbindgen.toml
│   ├── lightningcss.h
│   ├── src/
│   │   └── lib.rs
│   └── test.c
├── cli/
│   ├── .gitignore
│   ├── lightningcss
│   └── postinstall.js
├── derive/
│   ├── Cargo.toml
│   └── src/
│       ├── lib.rs
│       ├── parse.rs
│       ├── to_css.rs
│       └── visit.rs
├── examples/
│   ├── custom_at_rule.rs
│   ├── schema.rs
│   └── serialize.rs
├── napi/
│   ├── Cargo.toml
│   └── src/
│       ├── at_rule_parser.rs
│       ├── lib.rs
│       ├── threadsafe_function.rs
│       ├── transformer.rs
│       └── utils.rs
├── node/
│   ├── Cargo.toml
│   ├── ast.d.ts
│   ├── browserslistToTargets.js
│   ├── build.rs
│   ├── composeVisitors.js
│   ├── flags.js
│   ├── index.d.ts
│   ├── index.js
│   ├── index.mjs
│   ├── src/
│   │   └── lib.rs
│   ├── targets.d.ts
│   ├── test/
│   │   ├── bundle.test.mjs
│   │   ├── composeVisitors.test.mjs
│   │   ├── customAtRules.mjs
│   │   ├── transform.test.mjs
│   │   └── visitor.test.mjs
│   └── tsconfig.json
├── package.json
├── patches/
│   ├── @babel+types+7.26.3.patch
│   └── json-schema-to-typescript+11.0.5.patch
├── rust-toolchain.toml
├── rustfmt.toml
├── scripts/
│   ├── build-ast.js
│   ├── build-flow.js
│   ├── build-npm.js
│   ├── build-prefixes.js
│   ├── build-wasm.js
│   └── build.js
├── selectors/
│   ├── Cargo.toml
│   ├── LICENSE
│   ├── README.md
│   ├── attr.rs
│   ├── bloom.rs
│   ├── build.rs
│   ├── builder.rs
│   ├── context.rs
│   ├── lib.rs
│   ├── matching.rs
│   ├── nth_index_cache.rs
│   ├── parser.rs
│   ├── serialization.rs
│   ├── sink.rs
│   ├── tree.rs
│   └── visitor.rs
├── src/
│   ├── bundler.rs
│   ├── compat.rs
│   ├── context.rs
│   ├── css_modules.rs
│   ├── declaration.rs
│   ├── dependencies.rs
│   ├── error.rs
│   ├── lib.rs
│   ├── logical.rs
│   ├── macros.rs
│   ├── main.rs
│   ├── media_query.rs
│   ├── parser.rs
│   ├── prefixes.rs
│   ├── printer.rs
│   ├── properties/
│   │   ├── align.rs
│   │   ├── animation.rs
│   │   ├── background.rs
│   │   ├── border.rs
│   │   ├── border_image.rs
│   │   ├── border_radius.rs
│   │   ├── box_shadow.rs
│   │   ├── contain.rs
│   │   ├── css_modules.rs
│   │   ├── custom.rs
│   │   ├── display.rs
│   │   ├── effects.rs
│   │   ├── flex.rs
│   │   ├── font.rs
│   │   ├── grid.rs
│   │   ├── list.rs
│   │   ├── margin_padding.rs
│   │   ├── masking.rs
│   │   ├── mod.rs
│   │   ├── outline.rs
│   │   ├── overflow.rs
│   │   ├── position.rs
│   │   ├── prefix_handler.rs
│   │   ├── size.rs
│   │   ├── svg.rs
│   │   ├── text.rs
│   │   ├── transform.rs
│   │   ├── transition.rs
│   │   └── ui.rs
│   ├── rules/
│   │   ├── container.rs
│   │   ├── counter_style.rs
│   │   ├── custom_media.rs
│   │   ├── document.rs
│   │   ├── font_face.rs
│   │   ├── font_feature_values.rs
│   │   ├── font_palette_values.rs
│   │   ├── import.rs
│   │   ├── keyframes.rs
│   │   ├── layer.rs
│   │   ├── media.rs
│   │   ├── mod.rs
│   │   ├── namespace.rs
│   │   ├── nesting.rs
│   │   ├── page.rs
│   │   ├── property.rs
│   │   ├── scope.rs
│   │   ├── starting_style.rs
│   │   ├── style.rs
│   │   ├── supports.rs
│   │   ├── unknown.rs
│   │   ├── view_transition.rs
│   │   └── viewport.rs
│   ├── selector.rs
│   ├── serialization.rs
│   ├── stylesheet.rs
│   ├── targets.rs
│   ├── test_helpers.rs
│   ├── traits.rs
│   ├── values/
│   │   ├── alpha.rs
│   │   ├── angle.rs
│   │   ├── calc.rs
│   │   ├── color.rs
│   │   ├── easing.rs
│   │   ├── gradient.rs
│   │   ├── ident.rs
│   │   ├── image.rs
│   │   ├── length.rs
│   │   ├── mod.rs
│   │   ├── number.rs
│   │   ├── percentage.rs
│   │   ├── position.rs
│   │   ├── ratio.rs
│   │   ├── rect.rs
│   │   ├── resolution.rs
│   │   ├── shape.rs
│   │   ├── size.rs
│   │   ├── string.rs
│   │   ├── syntax.rs
│   │   ├── time.rs
│   │   └── url.rs
│   ├── vendor_prefix.rs
│   └── visitor.rs
├── static-self/
│   ├── Cargo.toml
│   └── src/
│       └── lib.rs
├── static-self-derive/
│   ├── Cargo.toml
│   └── src/
│       ├── into_owned.rs
│       └── lib.rs
├── test-integration.mjs
├── test.js
├── tests/
│   ├── cli_integration_tests.rs
│   ├── test_cssom.rs
│   ├── test_custom_parser.rs
│   ├── test_serde.rs
│   └── testdata/
│       ├── a.css
│       ├── apply.css
│       ├── b.css
│       ├── baz.css
│       ├── foo.css
│       ├── has_external.css
│       ├── hello/
│       │   └── world.css
│       └── mixin.css
├── wasm/
│   ├── .gitignore
│   ├── async.mjs
│   ├── import.meta.url-polyfill.js
│   ├── index.mjs
│   └── wasm-node.mjs
└── website/
    ├── .posthtmlrc
    ├── bundling.html
    ├── css-modules.html
    ├── docs.css
    ├── docs.html
    ├── docs.js
    ├── include/
    │   └── layout.html
    ├── index.html
    ├── minification.html
    ├── pages/
    │   ├── bundling.md
    │   ├── css-modules.md
    │   ├── docs.md
    │   ├── minification.md
    │   ├── transforms.md
    │   └── transpilation.md
    ├── playground/
    │   ├── index.html
    │   └── playground.js
    ├── synthwave.css
    ├── transforms.html
    └── transpilation.html
Download .txt
Showing preview only (300K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3700 symbols across 150 files)

FILE: bench.js
  function run (line 16) | async function run() {
  function doCssNano (line 35) | async function doCssNano() {

FILE: c/build.rs
  function main (line 3) | fn main() {

FILE: c/lightningcss.h
  type CssError (line 6) | typedef struct CssError CssError;
  type StyleSheet (line 8) | typedef struct StyleSheet StyleSheet;
  type Targets (line 10) | typedef struct Targets {
  type ParseOptions (line 22) | typedef struct ParseOptions {
  type TransformOptions (line 32) | typedef struct TransformOptions {
  type RawString (line 38) | typedef struct RawString {
  type CssModuleReference_Tag (line 43) | typedef enum CssModuleReference_Tag {
  type CssModuleReference_Local_Body (line 58) | typedef struct CssModuleReference_Local_Body {
  type CssModuleReference_Global_Body (line 65) | typedef struct CssModuleReference_Global_Body {
  type CssModuleReference_Dependency_Body (line 72) | typedef struct CssModuleReference_Dependency_Body {
  type CssModuleReference (line 83) | typedef struct CssModuleReference {
  type CssModuleExport (line 92) | typedef struct CssModuleExport {
  type CssModulePlaceholder (line 100) | typedef struct CssModulePlaceholder {
  type ToCssResult (line 105) | typedef struct ToCssResult {
  type PseudoClasses (line 114) | typedef struct PseudoClasses {
  type ToCssOptions (line 122) | typedef struct ToCssOptions {
  type Targets (line 134) | struct Targets
  type CssError (line 135) | struct CssError
  type StyleSheet (line 137) | struct StyleSheet
  type ParseOptions (line 139) | struct ParseOptions
  type CssError (line 140) | struct CssError
  type StyleSheet (line 142) | struct StyleSheet
  type TransformOptions (line 143) | struct TransformOptions
  type CssError (line 144) | struct CssError
  type ToCssResult (line 146) | struct ToCssResult
  type StyleSheet (line 146) | struct StyleSheet
  type ToCssOptions (line 147) | struct ToCssOptions
  type CssError (line 148) | struct CssError
  type StyleSheet (line 150) | struct StyleSheet
  type ToCssResult (line 152) | struct ToCssResult
  type CssError (line 154) | struct CssError
  type CssError (line 156) | struct CssError
  type StyleSheet (line 158) | struct StyleSheet
  type StyleSheet (line 160) | struct StyleSheet

FILE: c/src/lib.rs
  type StyleSheetWrapper (line 15) | pub struct StyleSheetWrapper<'i, 'o> {
  type CssError (line 21) | pub struct CssError<'i> {
  function message (line 27) | fn message(&mut self) -> *const c_char {
  type ErrorKind (line 46) | pub enum ErrorKind<'i> {
  type ParseOptions (line 76) | pub struct ParseOptions {
  type Targets (line 88) | pub struct Targets {
    method into (line 101) | fn into(self) -> Browsers {
  function lightningcss_browserslist_to_targets (line 139) | pub extern "C" fn lightningcss_browserslist_to_targets(
  type TransformOptions (line 168) | pub struct TransformOptions {
    method into (line 175) | fn into(self) -> MinifyOptions {
  type ToCssOptions (line 195) | pub struct ToCssOptions {
  type PseudoClasses (line 208) | pub struct PseudoClasses {
    method into (line 229) | fn into(self) -> lightningcss::printer::PseudoClasses<'a> {
  method default (line 217) | fn default() -> Self {
  function lightningcss_stylesheet_parse (line 251) | pub extern "C" fn lightningcss_stylesheet_parse(
  function lightningcss_stylesheet_transform (line 303) | pub extern "C" fn lightningcss_stylesheet_transform(
  function lightningcss_stylesheet_to_css (line 314) | pub extern "C" fn lightningcss_stylesheet_to_css(
  function lightningcss_stylesheet_free (line 426) | pub extern "C" fn lightningcss_stylesheet_free(stylesheet: *mut StyleShe...
  type ToCssResult (line 433) | pub struct ToCssResult {
  method default (line 443) | fn default() -> Self {
  method drop (line 456) | fn drop(&mut self) {
  function lightningcss_to_css_result_free (line 472) | pub extern "C" fn lightningcss_to_css_result_free(result: ToCssResult) {
  type CssModuleExport (line 477) | pub struct CssModuleExport {
  method drop (line 486) | fn drop(&mut self) {
  type CssModuleReference (line 496) | pub enum CssModuleReference {
    method from (line 517) | fn from(reference: lightningcss::css_modules::CssModuleReference) -> S...
  type CssModulePlaceholder (line 531) | pub struct CssModulePlaceholder {
  type RawString (line 537) | pub struct RawString {
    method from (line 552) | fn from(string: String) -> RawString {
  method default (line 543) | fn default() -> Self {
  method drop (line 561) | fn drop(&mut self) {
  function lightningcss_error_message (line 571) | pub extern "C" fn lightningcss_error_message(error: *mut CssError) -> *c...
  function lightningcss_error_free (line 579) | pub extern "C" fn lightningcss_error_free(error: *mut CssError) {
  function lightningcss_stylesheet_get_warning_count (line 586) | pub extern "C" fn lightningcss_stylesheet_get_warning_count<'i>(
  function lightningcss_stylesheet_get_warning (line 596) | pub extern "C" fn lightningcss_stylesheet_get_warning<'i>(

FILE: c/test.c
  function main (line 7) | int main()

FILE: derive/src/lib.rs
  function derive_visit_children (line 8) | pub fn derive_visit_children(input: TokenStream) -> TokenStream {
  function derive_parse (line 13) | pub fn derive_parse(input: TokenStream) -> TokenStream {
  function derive_to_css (line 18) | pub fn derive_to_css(input: TokenStream) -> TokenStream {

FILE: derive/src/parse.rs
  function derive_parse (line 9) | pub fn derive_parse(input: TokenStream) -> TokenStream {
  function derive_enum (line 44) | fn derive_enum(data: &DataEnum, ident: &Ident, opts: &CssOptions) -> Tok...
  type CssOptions (line 177) | pub struct CssOptions {
    method parse_attributes (line 182) | pub fn parse_attributes(attrs: &Vec<Attribute>) -> syn::Result<Self> {
  method parse (line 197) | fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {

FILE: derive/src/to_css.rs
  function derive_to_css (line 9) | pub fn derive_to_css(input: TokenStream) -> TokenStream {
  function derive_enum (line 40) | fn derive_enum(data: &DataEnum, opts: &CssOptions) -> TokenStream2 {
  function is_option (line 154) | fn is_option(ty: &Type) -> bool {

FILE: derive/src/visit.rs
  function derive_visit_children (line 11) | pub fn derive_visit_children(input: TokenStream) -> TokenStream {
  function derive (line 50) | fn derive(
  function skip_type (line 252) | fn skip_type(attrs: &Vec<Attribute>) -> bool {
  type VisitOptions (line 256) | struct VisitOptions {
  method parse (line 263) | fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {
  type VisitTypes (line 278) | struct VisitTypes {
  method parse (line 283) | fn parse(input: syn::parse::ParseStream) -> syn::Result<Self> {

FILE: examples/custom_at_rule.rs
  function main (line 23) | fn main() {
  type TailwindDirective (line 59) | enum TailwindDirective {
  type Prelude (line 67) | enum Prelude {
  type TailwindRule (line 74) | struct TailwindRule {
  type ApplyRule (line 81) | struct ApplyRule {
  type AtRule (line 88) | enum AtRule {
    constant CHILD_TYPES (line 286) | const CHILD_TYPES: VisitTypes = VisitTypes::empty();
    method visit_children (line 288) | fn visit_children(&mut self, _: &mut V) -> Result<(), V::Error> {
  type TailwindAtRuleParser (line 94) | struct TailwindAtRuleParser;
    type Prelude (line 96) | type Prelude = Prelude;
    type Error (line 97) | type Error = Infallible;
    type AtRule (line 98) | type AtRule = AtRule;
    method parse_prelude (line 100) | fn parse_prelude<'t>(
    method rule_without_block (line 137) | fn rule_without_block(
  type StyleRuleCollector (line 152) | struct StyleRuleCollector<'i, 'a> {
  type Error (line 157) | type Error = Infallible;
  function visit_types (line 159) | fn visit_types(&self) -> VisitTypes {
  function visit_rule (line 163) | fn visit_rule(&mut self, rule: &mut lightningcss::rules::CssRule<'i, AtR...
  type ApplyVisitor (line 187) | struct ApplyVisitor<'a, 'i> {
  type Error (line 192) | type Error = Infallible;
  function visit_types (line 194) | fn visit_types(&self) -> VisitTypes {
  function visit_rule (line 198) | fn visit_rule(&mut self, rule: &mut CssRule<'i, AtRule>) -> Result<(), S...
  function visit_url (line 227) | fn visit_url(&mut self, url: &mut lightningcss::values::url::Url<'i>) ->...
  function visit_color (line 232) | fn visit_color(&mut self, color: &mut lightningcss::values::color::CssCo...
  function visit_length (line 237) | fn visit_length(&mut self, length: &mut lightningcss::values::length::Le...
  function visit_dashed_ident (line 246) | fn visit_dashed_ident(
  function visit_selector (line 254) | fn visit_selector(&mut self, selector: &mut Selector<'i>) -> Result<(), ...
  function visit_token (line 267) | fn visit_token(&mut self, token: &mut TokenOrValue<'i>) -> Result<(), Se...
  method to_css (line 294) | fn to_css<W: std::fmt::Write>(&self, dest: &mut Printer<W>) -> Result<()...

FILE: examples/schema.rs
  function main (line 1) | fn main() {

FILE: examples/serialize.rs
  function main (line 1) | fn main() {
  function parse (line 6) | fn parse() {
  function parse (line 25) | fn parse() {

FILE: napi/src/at_rule_parser.rs
  type CustomAtRuleConfig (line 18) | pub struct CustomAtRuleConfig {
  function deserialize_prelude (line 24) | fn deserialize_prelude<'de, D>(deserializer: D) -> Result<Option<SyntaxS...
  type CustomAtRuleBodyType (line 40) | enum CustomAtRuleBodyType {
  type Prelude (line 46) | pub struct Prelude<'i> {
  type AtRule (line 52) | pub struct AtRule<'i> {
  type AtRuleBody (line 62) | pub enum AtRuleBody<'i> {
  type CustomAtRuleParser (line 69) | pub struct CustomAtRuleParser {
    type Prelude (line 74) | type Prelude = Prelude<'i>;
    type Error (line 75) | type Error = ParserError<'i>;
    type AtRule (line 76) | type AtRule = AtRule<'i>;
    method parse_prelude (line 78) | fn parse_prelude<'t>(
    method parse_block (line 99) | fn parse_block<'t>(
    method rule_without_block (line 137) | fn rule_without_block(
  method to_css (line 164) | fn to_css<W>(
  constant CHILD_TYPES (line 205) | const CHILD_TYPES: VisitTypes = VisitTypes::empty();
  function visit_children (line 207) | fn visit_children(&mut self, visitor: &mut V) -> Result<(), V::Error> {

FILE: napi/src/lib.rs
  type JsVisitor (line 33) | struct JsVisitor;
  type TransformResult (line 42) | struct TransformResult<'i> {
  function into_js (line 54) | fn into_js(self, env: Env) -> napi::Result<JsUnknown> {
  function get_visitor (line 78) | fn get_visitor(env: Env, opts: &JsObject) -> Option<JsVisitor> {
  function get_visitor (line 87) | fn get_visitor(_env: Env, _opts: &JsObject) -> Option<JsVisitor> {
  function transform (line 91) | pub fn transform(ctx: CallContext) -> napi::Result<JsUnknown> {
  function transform_style_attribute (line 105) | pub fn transform_style_attribute(ctx: CallContext) -> napi::Result<JsUnk...
  function bundle (line 131) | pub fn bundle(ctx: CallContext) -> napi::Result<JsUnknown> {
  type JsSourceProvider (line 160) | struct JsSourceProvider {
  type Error (line 176) | type Error = napi::Error;
  method read (line 178) | fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
  method resolve (line 207) | fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<Re...
  type ResolveMessage (line 225) | struct ResolveMessage {
  type ReadMessage (line 231) | struct ReadMessage {
  type VisitMessage (line 236) | struct VisitMessage {
  function await_promise (line 241) | fn await_promise<T, Cb>(env: Env, result: JsUnknown, tx: Sender<napi::Re...
  function resolve_on_js_thread (line 271) | fn resolve_on_js_thread(ctx: ThreadSafeCallContext<ResolveMessage>) -> n...
  function handle_error (line 280) | fn handle_error<T>(tx: Sender<napi::Result<T>>, res: napi::Result<()>) -...
  function resolve_on_js_thread_wrapper (line 290) | fn resolve_on_js_thread_wrapper(ctx: ThreadSafeCallContext<ResolveMessag...
  function read_on_js_thread (line 295) | fn read_on_js_thread(ctx: ThreadSafeCallContext<ReadMessage>) -> napi::R...
  function read_on_js_thread_wrapper (line 303) | fn read_on_js_thread_wrapper(ctx: ThreadSafeCallContext<ReadMessage>) ->...
  function bundle_async (line 308) | pub fn bundle_async(ctx: CallContext) -> napi::Result<JsObject> {
  function run_bundle_task (line 356) | fn run_bundle_task<P: 'static + SourceProvider>(
  function bundle (line 431) | pub fn bundle(ctx: CallContext) -> napi::Result<JsUnknown> {
  type JsSourceProvider (line 473) | struct JsSourceProvider {
  method drop (line 481) | fn drop(&mut self) {
  function await_promise_sync (line 495) | fn await_promise_sync(
  function get_result (line 502) | fn get_result(env: Env, mut value: JsUnknown) -> napi::Result<JsUnknown> {
  type Error (line 522) | type Error = napi::Error;
  method read (line 524) | fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
  method resolve (line 542) | fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<Re...
  type Config (line 565) | struct Config {
  type AnalyzeDependenciesOption (line 590) | enum AnalyzeDependenciesOption {
  type AnalyzeDependenciesConfig (line 597) | struct AnalyzeDependenciesConfig {
  type CssModulesOption (line 603) | enum CssModulesOption {
  type CssModulesConfig (line 610) | struct CssModulesConfig {
  type BundleConfig (line 623) | struct BundleConfig {
  type OwnedPseudoClasses (line 645) | struct OwnedPseudoClasses {
  function into (line 654) | fn into(self) -> PseudoClasses<'a> {
  type Drafts (line 667) | struct Drafts {
  type NonStandard (line 674) | struct NonStandard {
  function compile (line 679) | fn compile<'i>(
  function compile_bundle (line 812) | fn compile_bundle<
  type AttrConfig (line 943) | struct AttrConfig {
  type AttrResult (line 962) | struct AttrResult<'i> {
  function into_js (line 970) | fn into_js(self, ctx: CallContext) -> napi::Result<JsUnknown> {
  function compile_attr (line 982) | fn compile_attr<'i>(
  type CompileError (line 1047) | enum CompileError<'i, E: std::error::Error> {
  function fmt (line 1059) | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
  function into_js_error (line 1074) | fn into_js_error(self, env: Env, code: Option<&str>) -> napi::Result<nap...
  type IntoJsError (line 1129) | trait IntoJsError {
    method into_js_error (line 1130) | fn into_js_error(self, env: Env) -> napi::Result<JsUnknown>;
    method into_js_error (line 1134) | fn into_js_error(self, env: Env) -> napi::Result<JsUnknown> {
    method into_js_error (line 1144) | fn into_js_error(self, env: Env) -> napi::Result<JsUnknown> {
  function from (line 1150) | fn from(e: Error<ParserError<'i>>) -> CompileError<'i, E> {
  function from (line 1156) | fn from(err: Error<MinifyErrorKind>) -> CompileError<'i, E> {
  function from (line 1162) | fn from(err: Error<PrinterErrorKind>) -> CompileError<'i, E> {
  function from (line 1168) | fn from(e: parcel_sourcemap::SourceMapError) -> CompileError<'i, E> {
  function from (line 1174) | fn from(e: Error<BundleErrorKind<'i, E>>) -> CompileError<'i, E> {
  function from (line 1180) | fn from(e: CompileError<'i, E>) -> napi::Error {
  type Warning (line 1192) | struct Warning<'i> {
  function from (line 1200) | fn from(mut e: Error<ParserError<'i>>) -> Self {

FILE: napi/src/threadsafe_function.rs
  type ThreadSafeCallContext (line 19) | pub struct ThreadSafeCallContext<T: 'static> {
  type ThreadsafeFunctionCallMode (line 26) | pub enum ThreadsafeFunctionCallMode {
  function from (line 32) | fn from(value: ThreadsafeFunctionCallMode) -> Self {
  type ThreadsafeFunction (line 89) | pub struct ThreadsafeFunction<T: 'static> {
  method clone (line 97) | fn clone(&self) -> Self {
  function create (line 121) | pub(crate) fn create<R: 'static + Send + FnMut(ThreadSafeCallContext<T>)...
  function call (line 168) | pub fn call(&self, value: T, mode: ThreadsafeFunctionCallMode) -> Status {
  method drop (line 180) | fn drop(&mut self) {
  function cleanup_cb (line 193) | unsafe extern "C" fn cleanup_cb(cleanup_data: *mut c_void) {
  function thread_finalize_cb (line 198) | unsafe extern "C" fn thread_finalize_cb<T: 'static, R>(
  function call_js_cb (line 209) | unsafe extern "C" fn call_js_cb<T: 'static, R>(

FILE: napi/src/transformer.rs
  type JsVisitor (line 29) | pub struct JsVisitor {
    method new (line 176) | pub fn new(env: Env, visitor: JsObject) -> Self {
    type Error (line 255) | type Error = napi::Error;
    method visit_types (line 257) | fn visit_types(&self) -> VisitTypes {
    method visit_stylesheet (line 261) | fn visit_stylesheet<'o>(&mut self, stylesheet: &mut StyleSheet<'i, 'o,...
    method visit_rule_list (line 281) | fn visit_rule_list(
    method visit_declaration_block (line 358) | fn visit_declaration_block(
    method visit_length (line 386) | fn visit_length(&mut self, length: &mut LengthValue) -> Result<(), Sel...
    method visit_angle (line 390) | fn visit_angle(&mut self, angle: &mut lightningcss::values::angle::Ang...
    method visit_ratio (line 394) | fn visit_ratio(&mut self, ratio: &mut lightningcss::values::ratio::Rat...
    method visit_resolution (line 398) | fn visit_resolution(
    method visit_time (line 405) | fn visit_time(&mut self, time: &mut lightningcss::values::time::Time) ...
    method visit_color (line 409) | fn visit_color(&mut self, color: &mut lightningcss::values::color::Css...
    method visit_image (line 413) | fn visit_image(&mut self, image: &mut lightningcss::values::image::Ima...
    method visit_url (line 419) | fn visit_url(&mut self, url: &mut lightningcss::values::url::Url<'i>) ...
    method visit_media_list (line 423) | fn visit_media_list(&mut self, media: &mut lightningcss::media_query::...
    method visit_media_feature_value (line 446) | fn visit_media_feature_value(&mut self, value: &mut MediaFeatureValue<...
    method visit_supports_condition (line 493) | fn visit_supports_condition(
    method visit_custom_ident (line 502) | fn visit_custom_ident(
    method visit_dashed_ident (line 509) | fn visit_dashed_ident(
    method visit_selector_list (line 516) | fn visit_selector_list(
    method visit_token_list (line 535) | fn visit_token_list(
  type VisitStage (line 64) | enum VisitStage {
  type VisitorsRef (line 69) | type VisitorsRef = Visitors<Ref<()>>;
  type Visitors (line 71) | struct Visitors<T> {
  function new (line 77) | fn new(enter: Option<T>, exit: Option<T>) -> Self {
  function for_stage (line 81) | fn for_stage(&self, stage: VisitStage) -> Option<&T> {
  function get (line 90) | fn get<U: napi::NapiValue>(&self, env: &Env) -> Visitors<U> {
  function named (line 99) | fn named(&self, stage: VisitStage, name: &str) -> Option<JsFunction> {
  function custom (line 105) | fn custom(&self, stage: VisitStage, obj: &str, name: &str) -> Option<JsF...
  method drop (line 127) | fn drop(&mut self) {
  function visit (line 607) | fn visit<V: Serialize + Deserialize<'static>>(
  function call_visitor (line 622) | fn call_visitor<V: Serialize + Deserialize<'static>>(
  function visit_declaration_list (line 638) | fn visit_declaration_list<'i, C: FnMut(&mut Property<'i>) -> napi::Resul...
  function visit_list (line 674) | fn visit_list<
  function map (line 713) | fn map<V, L: List<V>, F: FnMut(&mut V) -> napi::Result<Option<ValueOrVec...
  type ValueOrVec (line 745) | enum ValueOrVec<V, const IS_VEC: bool = false> {
  function deserialize (line 753) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  type TokensOrRaw (line 808) | struct TokensOrRaw<'i>(ValueOrVec<TokenOrValue<'i>>);
  function deserialize (line 811) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  type List (line 837) | trait List<V>: Index<usize, Output = V> + IndexMut<usize, Output = V> {
    method len (line 838) | fn len(&self) -> usize;
    method remove (line 839) | fn remove(&mut self, i: usize);
    method replace (line 840) | fn replace(&mut self, i: usize, items: Vec<V>);
  function len (line 844) | fn len(&self) -> usize {
  function remove (line 848) | fn remove(&mut self, i: usize) {
  function replace (line 852) | fn replace(&mut self, i: usize, items: Vec<V>) {
  function len (line 858) | fn len(&self) -> usize {
  function remove (line 862) | fn remove(&mut self, i: usize) {
  function replace (line 866) | fn replace(&mut self, i: usize, items: Vec<V>) {
  function len (line 877) | fn len(&self) -> usize {
  function remove (line 881) | fn remove(&mut self, i: usize) {
  function replace (line 885) | fn replace(&mut self, i: usize, items: Vec<CssRule<'i, R>>) {

FILE: napi/src/utils.rs
  function get_named_property (line 4) | pub fn get_named_property<T: TryFrom<JsUnknown, Error = Error>>(obj: &Js...

FILE: node/ast.d.ts
  type String (line 8) | type String = string;
  type Rule (line 12) | type Rule<D = Declaration, M = MediaQuery> = | {
  type MediaCondition (line 118) | type MediaCondition =
  type QueryFeatureFor_MediaFeatureId (line 145) | type QueryFeatureFor_MediaFeatureId =
  type MediaFeatureNameFor_MediaFeatureId (line 205) | type MediaFeatureNameFor_MediaFeatureId = MediaFeatureId | String | String;
  type MediaFeatureId (line 209) | type MediaFeatureId =
  type MediaFeatureValue (line 254) | type MediaFeatureValue =
  type Length (line 290) | type Length =
  type LengthUnit (line 299) | type LengthUnit =
  type CalcFor_Length (line 354) | type CalcFor_Length =
  type MathFunctionFor_Length (line 388) | type MathFunctionFor_Length =
  type RoundingStrategy (line 448) | type RoundingStrategy = "nearest" | "up" | "down" | "to-zero";
  type Resolution (line 452) | type Resolution =
  type Ratio (line 471) | type Ratio = [number, number];
  type TokenOrValue (line 475) | type TokenOrValue =
  type Token (line 531) | type Token =
  type CssColor (line 660) | type CssColor = CurrentColor | RGBColor | LABColor | PredefinedColor | F...
  type CurrentColor (line 661) | type CurrentColor = {
  type RGBColor (line 664) | type RGBColor = {
  type LABColor (line 686) | type LABColor =
  type PredefinedColor (line 766) | type PredefinedColor =
  type FloatColor (line 922) | type FloatColor =
  type LightDark (line 980) | type LightDark = {
  type SystemColor (line 988) | type SystemColor =
  type UnresolvedColor (line 1034) | type UnresolvedColor =
  type Specifier (line 1089) | type Specifier =
  type Angle (line 1106) | type Angle =
  type Time (line 1128) | type Time =
  type AnimationName (line 1140) | type AnimationName =
  type EnvironmentVariableName (line 1155) | type EnvironmentVariableName =
  type UAEnvironmentVariable (line 1178) | type UAEnvironmentVariable =
  type MediaFeatureComparison (line 1192) | type MediaFeatureComparison = "equal" | "greater-than" | "greater-than-e...
  type Operator (line 1196) | type Operator = "and" | "or";
  type MediaType (line 1197) | type MediaType = string;
  type Qualifier (line 1201) | type Qualifier = "only" | "not";
  type SupportsCondition (line 1205) | type SupportsCondition =
  type PropertyId (line 1237) | type PropertyId =
  type Prefix (line 2380) | type Prefix = "none" | "webkit" | "moz" | "ms" | "o";
  type VendorPrefix (line 2381) | type VendorPrefix = Prefix[];
  type Declaration (line 2382) | type Declaration =
  type Image (line 3882) | type Image =
  type Gradient (line 3901) | type Gradient =
  type LineDirection (line 4047) | type LineDirection =
  type HorizontalPositionKeyword (line 4074) | type HorizontalPositionKeyword = "left" | "right";
  type VerticalPositionKeyword (line 4078) | type VerticalPositionKeyword = "top" | "bottom";
  type GradientItemFor_DimensionPercentageFor_LengthValue (line 4084) | type GradientItemFor_DimensionPercentageFor_LengthValue =
  type DimensionPercentageFor_LengthValue (line 4105) | type DimensionPercentageFor_LengthValue =
  type CalcFor_DimensionPercentageFor_LengthValue (line 4123) | type CalcFor_DimensionPercentageFor_LengthValue =
  type MathFunctionFor_DimensionPercentageFor_LengthValue (line 4157) | type MathFunctionFor_DimensionPercentageFor_LengthValue =
  type PositionComponentFor_HorizontalPositionKeyword (line 4223) | type PositionComponentFor_HorizontalPositionKeyword =
  type PositionComponentFor_VerticalPositionKeyword (line 4247) | type PositionComponentFor_VerticalPositionKeyword =
  type EndingShape (line 4271) | type EndingShape =
  type Ellipse (line 4285) | type Ellipse =
  type ShapeExtent (line 4306) | type ShapeExtent = "closest-side" | "farthest-side" | "closest-corner" |...
  type Circle (line 4312) | type Circle =
  type GradientItemFor_DimensionPercentageFor_Angle (line 4326) | type GradientItemFor_DimensionPercentageFor_Angle =
  type DimensionPercentageFor_Angle (line 4347) | type DimensionPercentageFor_Angle =
  type CalcFor_DimensionPercentageFor_Angle (line 4365) | type CalcFor_DimensionPercentageFor_Angle =
  type MathFunctionFor_DimensionPercentageFor_Angle (line 4399) | type MathFunctionFor_DimensionPercentageFor_Angle =
  type WebKitGradientPointComponentFor_HorizontalPositionKeyword (line 4463) | type WebKitGradientPointComponentFor_HorizontalPositionKeyword =
  type NumberOrPercentage (line 4478) | type NumberOrPercentage =
  type WebKitGradientPointComponentFor_VerticalPositionKeyword (line 4490) | type WebKitGradientPointComponentFor_VerticalPositionKeyword =
  type BackgroundSize (line 4505) | type BackgroundSize =
  type LengthPercentageOrAuto (line 4526) | type LengthPercentageOrAuto =
  type BackgroundRepeatKeyword (line 4539) | type BackgroundRepeatKeyword = "repeat" | "space" | "round" | "no-repeat";
  type BackgroundAttachment (line 4543) | type BackgroundAttachment = "scroll" | "fixed" | "local";
  type BackgroundClip (line 4547) | type BackgroundClip = "border-box" | "padding-box" | "content-box" | "bo...
  type BackgroundOrigin (line 4551) | type BackgroundOrigin = "border-box" | "padding-box" | "content-box";
  type Display (line 4555) | type Display =
  type DisplayKeyword (line 4580) | type DisplayKeyword =
  type DisplayInside (line 4598) | type DisplayInside =
  type DisplayOutside (line 4625) | type DisplayOutside = "block" | "inline" | "run-in";
  type Visibility (line 4629) | type Visibility = "visible" | "hidden" | "collapse";
  type Size (line 4633) | type Size =
  type MaxSize (line 4667) | type MaxSize =
  type BoxSizing (line 4701) | type BoxSizing = "content-box" | "border-box";
  type OverflowKeyword (line 4705) | type OverflowKeyword = "visible" | "hidden" | "clip" | "scroll" | "auto";
  type TextOverflow (line 4709) | type TextOverflow = "clip" | "ellipsis";
  type Position2 (line 4713) | type Position2 =
  type Size2DFor_Length (line 4738) | type Size2DFor_Length = [Length, Length];
  type LineStyle (line 4742) | type LineStyle =
  type BorderSideWidth (line 4756) | type BorderSideWidth =
  type Size2DFor_DimensionPercentageFor_LengthValue (line 4778) | type Size2DFor_DimensionPercentageFor_LengthValue = [
  type RectFor_LengthOrNumber (line 4790) | type RectFor_LengthOrNumber = [LengthOrNumber, LengthOrNumber, LengthOrN...
  type LengthOrNumber (line 4794) | type LengthOrNumber =
  type BorderImageRepeatKeyword (line 4806) | type BorderImageRepeatKeyword = "stretch" | "repeat" | "round" | "space";
  type RectFor_BorderImageSideWidth (line 4815) | type RectFor_BorderImageSideWidth = [
  type BorderImageSideWidth (line 4824) | type BorderImageSideWidth =
  type RectFor_NumberOrPercentage (line 4844) | type RectFor_NumberOrPercentage = [
  type OutlineStyle (line 4853) | type OutlineStyle =
  type FlexDirection (line 4864) | type FlexDirection = "row" | "row-reverse" | "column" | "column-reverse";
  type FlexWrap (line 4868) | type FlexWrap = "nowrap" | "wrap" | "wrap-reverse";
  type AlignContent (line 4872) | type AlignContent =
  type BaselinePosition (line 4898) | type BaselinePosition = "first" | "last";
  type ContentDistribution (line 4902) | type ContentDistribution = "space-between" | "space-around" | "space-eve...
  type OverflowPosition (line 4906) | type OverflowPosition = "safe" | "unsafe";
  type ContentPosition (line 4910) | type ContentPosition = "center" | "start" | "end" | "flex-start" | "flex...
  type JustifyContent (line 4914) | type JustifyContent =
  type AlignSelf (line 4950) | type AlignSelf =
  type SelfPosition (line 4978) | type SelfPosition = "center" | "start" | "end" | "self-start" | "self-en...
  type JustifySelf (line 4982) | type JustifySelf =
  type AlignItems (line 5024) | type AlignItems =
  type JustifyItems (line 5049) | type JustifyItems =
  type LegacyJustify (line 5092) | type LegacyJustify = "left" | "right" | "center";
  type GapValue (line 5096) | type GapValue =
  type BoxOrient (line 5107) | type BoxOrient = "horizontal" | "vertical" | "inline-axis" | "block-axis";
  type BoxDirection (line 5111) | type BoxDirection = "normal" | "reverse";
  type BoxAlign (line 5115) | type BoxAlign = "start" | "end" | "center" | "baseline" | "stretch";
  type BoxPack (line 5119) | type BoxPack = "start" | "end" | "center" | "justify";
  type BoxLines (line 5123) | type BoxLines = "single" | "multiple";
  type FlexPack (line 5127) | type FlexPack = "start" | "end" | "center" | "justify" | "distribute";
  type FlexItemAlign (line 5131) | type FlexItemAlign = "auto" | "start" | "end" | "center" | "baseline" | ...
  type FlexLinePack (line 5135) | type FlexLinePack = "start" | "end" | "center" | "justify" | "distribute...
  type TrackSizing (line 5139) | type TrackSizing =
  type TrackListItem (line 5159) | type TrackListItem =
  type TrackSize (line 5173) | type TrackSize =
  type TrackBreadth (line 5198) | type TrackBreadth =
  type RepeatCount (line 5221) | type RepeatCount =
  type AutoFlowDirection (line 5232) | type AutoFlowDirection = "row" | "column";
  type GridTemplateAreas (line 5236) | type GridTemplateAreas =
  type GridLine (line 5254) | type GridLine =
  type FontWeight (line 5290) | type FontWeight =
  type AbsoluteFontWeight (line 5306) | type AbsoluteFontWeight =
  type FontSize (line 5320) | type FontSize =
  type AbsoluteFontSize (line 5338) | type AbsoluteFontSize =
  type RelativeFontSize (line 5352) | type RelativeFontSize = "smaller" | "larger";
  type FontStretch (line 5356) | type FontStretch =
  type FontStretchKeyword (line 5370) | type FontStretchKeyword =
  type FontFamily (line 5383) | type FontFamily = GenericFontFamily | String;
  type GenericFontFamily (line 5389) | type GenericFontFamily =
  type FontStyle (line 5412) | type FontStyle =
  type FontVariantCaps (line 5426) | type FontVariantCaps =
  type LineHeight (line 5437) | type LineHeight =
  type VerticalAlign (line 5452) | type VerticalAlign =
  type VerticalAlignKeyword (line 5464) | type VerticalAlignKeyword =
  type EasingFunction (line 5476) | type EasingFunction =
  type StepPosition (line 5525) | type StepPosition =
  type AnimationIterationCount (line 5541) | type AnimationIterationCount =
  type AnimationDirection (line 5552) | type AnimationDirection = "normal" | "reverse" | "alternate" | "alternat...
  type AnimationPlayState (line 5556) | type AnimationPlayState = "running" | "paused";
  type AnimationFillMode (line 5560) | type AnimationFillMode = "none" | "forwards" | "backwards" | "both";
  type AnimationComposition (line 5564) | type AnimationComposition = "replace" | "add" | "accumulate";
  type AnimationTimeline (line 5568) | type AnimationTimeline =
  type ScrollAxis (line 5590) | type ScrollAxis = "block" | "inline" | "x" | "y";
  type Scroller (line 5594) | type Scroller = "root" | "nearest" | "self";
  type Size2DFor_LengthPercentageOrAuto (line 5603) | type Size2DFor_LengthPercentageOrAuto = [LengthPercentageOrAuto, LengthP...
  type AnimationRangeStart (line 5607) | type AnimationRangeStart = AnimationAttachmentRange;
  type AnimationAttachmentRange (line 5611) | type AnimationAttachmentRange =
  type TimelineRangeName (line 5625) | type TimelineRangeName = "cover" | "contain" | "entry" | "exit" | "entry...
  type AnimationRangeEnd (line 5629) | type AnimationRangeEnd = AnimationAttachmentRange;
  type Transform (line 5633) | type Transform =
  type TransformStyle (line 5745) | type TransformStyle = "flat" | "preserve3d";
  type TransformBox (line 5749) | type TransformBox = "content-box" | "border-box" | "fill-box" | "stroke-...
  type BackfaceVisibility (line 5753) | type BackfaceVisibility = "visible" | "hidden";
  type Perspective (line 5757) | type Perspective =
  type Translate (line 5768) | type Translate =
  type Scale (line 5787) | type Scale =
  type TextTransformCase (line 5806) | type TextTransformCase = "none" | "uppercase" | "lowercase" | "capitalize";
  type WhiteSpace (line 5810) | type WhiteSpace = "normal" | "pre" | "nowrap" | "pre-wrap" | "break-spac...
  type WordBreak (line 5814) | type WordBreak = "normal" | "keep-all" | "break-all" | "break-word";
  type LineBreak (line 5818) | type LineBreak = "auto" | "loose" | "normal" | "strict" | "anywhere";
  type Hyphens (line 5822) | type Hyphens = "none" | "manual" | "auto";
  type OverflowWrap (line 5826) | type OverflowWrap = "normal" | "anywhere" | "break-word";
  type TextAlign (line 5830) | type TextAlign = "start" | "end" | "left" | "right" | "center" | "justif...
  type TextAlignLast (line 5834) | type TextAlignLast = "auto" | "start" | "end" | "left" | "right" | "cent...
  type TextJustify (line 5838) | type TextJustify = "auto" | "none" | "inter-word" | "inter-character";
  type Spacing (line 5842) | type Spacing =
  type TextDecorationLine (line 5850) | type TextDecorationLine = ExclusiveTextDecorationLine | OtherTextDecorat...
  type ExclusiveTextDecorationLine (line 5851) | type ExclusiveTextDecorationLine = "none" | "spelling-error" | "grammar-...
  type OtherTextDecorationLine (line 5852) | type OtherTextDecorationLine = "underline" | "overline" | "line-through"...
  type TextDecorationStyle (line 5856) | type TextDecorationStyle = "solid" | "double" | "dotted" | "dashed" | "w...
  type TextDecorationThickness (line 5860) | type TextDecorationThickness =
  type TextDecorationSkipInk (line 5874) | type TextDecorationSkipInk = "auto" | "none" | "all";
  type TextEmphasisStyle (line 5878) | type TextEmphasisStyle =
  type TextEmphasisFillMode (line 5902) | type TextEmphasisFillMode = "filled" | "open";
  type TextEmphasisShape (line 5908) | type TextEmphasisShape = "dot" | "circle" | "double-circle" | "triangle"...
  type TextEmphasisPositionHorizontal (line 5914) | type TextEmphasisPositionHorizontal = "left" | "right";
  type TextEmphasisPositionVertical (line 5920) | type TextEmphasisPositionVertical = "over" | "under";
  type TextSizeAdjust (line 5924) | type TextSizeAdjust =
  type Direction2 (line 5938) | type Direction2 = "ltr" | "rtl";
  type UnicodeBidi (line 5942) | type UnicodeBidi = "normal" | "embed" | "isolate" | "bidi-override" | "i...
  type BoxDecorationBreak (line 5946) | type BoxDecorationBreak = "slice" | "clone";
  type Resize (line 5950) | type Resize = "none" | "both" | "horizontal" | "vertical" | "block" | "i...
  type CursorKeyword (line 5956) | type CursorKeyword =
  type ColorOrAuto (line 5996) | type ColorOrAuto =
  type CaretShape (line 6007) | type CaretShape = "auto" | "bar" | "block" | "underscore";
  type UserSelect (line 6011) | type UserSelect = "auto" | "text" | "none" | "contain" | "all";
  type Appearance (line 6012) | type Appearance = string;
  type ListStyleType (line 6016) | type ListStyleType =
  type CounterStyle (line 6031) | type CounterStyle =
  type PredefinedCounterStyle (line 6054) | type PredefinedCounterStyle =
  type Symbol (line 6114) | type Symbol =
  type SymbolsType (line 6128) | type SymbolsType = "cyclic" | "numeric" | "alphabetic" | "symbolic" | "f...
  type ListStylePosition (line 6132) | type ListStylePosition = "inside" | "outside";
  type MarkerSide (line 6136) | type MarkerSide = "match-self" | "match-parent";
  type SVGPaint (line 6140) | type SVGPaint =
  type SVGPaintFallback (line 6170) | type SVGPaintFallback =
  type FillRule (line 6183) | type FillRule = "nonzero" | "evenodd";
  type StrokeLinecap (line 6187) | type StrokeLinecap = "butt" | "round" | "square";
  type StrokeLinejoin (line 6191) | type StrokeLinejoin = "miter" | "miter-clip" | "round" | "bevel" | "arcs";
  type StrokeDasharray (line 6195) | type StrokeDasharray =
  type Marker (line 6206) | type Marker =
  type ColorInterpolation (line 6217) | type ColorInterpolation = "auto" | "srgb" | "linearrgb";
  type ColorRendering (line 6221) | type ColorRendering = "auto" | "optimizespeed" | "optimizequality";
  type ShapeRendering (line 6225) | type ShapeRendering = "auto" | "optimizespeed" | "crispedges" | "geometr...
  type TextRendering (line 6229) | type TextRendering = "auto" | "optimizespeed" | "optimizelegibility" | "...
  type ImageRendering (line 6233) | type ImageRendering = "auto" | "optimizespeed" | "optimizequality";
  type ClipPath (line 6237) | type ClipPath =
  type GeometryBox (line 6263) | type GeometryBox =
  type BasicShape (line 6274) | type BasicShape =
  type RectFor_DimensionPercentageFor_LengthValue (line 6299) | type RectFor_DimensionPercentageFor_LengthValue = [
  type ShapeRadius (line 6308) | type ShapeRadius =
  type MaskMode (line 6322) | type MaskMode = "luminance" | "alpha" | "match-source";
  type MaskClip (line 6326) | type MaskClip =
  type MaskComposite (line 6337) | type MaskComposite = "add" | "subtract" | "intersect" | "exclude";
  type MaskType (line 6341) | type MaskType = "luminance" | "alpha";
  type MaskBorderMode (line 6345) | type MaskBorderMode = "luminance" | "alpha";
  type WebKitMaskComposite (line 6351) | type WebKitMaskComposite =
  type WebKitMaskSourceType (line 6362) | type WebKitMaskSourceType = "auto" | "luminance" | "alpha";
  type FilterList (line 6366) | type FilterList =
  type Filter (line 6377) | type Filter =
  type ZIndex (line 6425) | type ZIndex =
  type ContainerType (line 6436) | type ContainerType = "normal" | "inline-size" | "size" | "scroll-state";
  type ContainerNameList (line 6440) | type ContainerNameList =
  type ViewTransitionName (line 6451) | type ViewTransitionName =
  type NoneOrCustomIdentList (line 6456) | type NoneOrCustomIdentList =
  type ViewTransitionGroup (line 6461) | type ViewTransitionGroup =
  type PrintColorAdjust (line 6466) | type PrintColorAdjust = "economy" | "exact";
  type CSSWideKeyword (line 6470) | type CSSWideKeyword = "initial" | "inherit" | "unset" | "revert" | "reve...
  type CustomPropertyName (line 6474) | type CustomPropertyName = String | String;
  type SelectorComponent (line 6475) | type SelectorComponent =
  type Combinator (line 6525) | type Combinator =
  type NamespaceConstraint (line 6532) | type NamespaceConstraint =
  type ParsedCaseSensitivity (line 6541) | type ParsedCaseSensitivity =
  type AttrSelectorOperator (line 6546) | type AttrSelectorOperator = "equal" | "includes" | "dash-match" | "prefi...
  type TSPseudoClass (line 6547) | type TSPseudoClass =
  type PseudoClass (line 6635) | type PseudoClass =
  type Direction (line 6850) | type Direction = "ltr" | "rtl";
  type WebKitScrollbarPseudoClass (line 6854) | type WebKitScrollbarPseudoClass =
  type BuiltinPseudoElement (line 6866) | type BuiltinPseudoElement =
  type PseudoElement (line 6878) | type PseudoElement =
  type WebKitScrollbarPseudoElement (line 7011) | type WebKitScrollbarPseudoElement =
  type ViewTransitionPartName (line 7019) | type ViewTransitionPartName = string;
  type Selector (line 7020) | type Selector = SelectorComponent[];
  type SelectorList (line 7021) | type SelectorList = Selector[];
  type KeyframeSelector (line 7025) | type KeyframeSelector =
  type KeyframesName (line 7043) | type KeyframesName =
  type FontFaceProperty (line 7057) | type FontFaceProperty =
  type Source (line 7089) | type Source =
  type FontFormat (line 7101) | type FontFormat =
  type FontTechnology (line 7130) | type FontTechnology =
  type FontStyle2 (line 7145) | type FontStyle2 =
  type Size2DFor_Angle (line 7164) | type Size2DFor_Angle = [Angle, Angle];
  type Size2DFor_FontWeight (line 7173) | type Size2DFor_FontWeight = [FontWeight, FontWeight];
  type Size2DFor_FontStretch (line 7182) | type Size2DFor_FontStretch = [FontStretch, FontStretch];
  type FontPaletteValuesProperty (line 7188) | type FontPaletteValuesProperty =
  type BasePalette (line 7208) | type BasePalette =
  type FontFeatureSubruleType (line 7222) | type FontFeatureSubruleType =
  type PageMarginBox (line 7233) | type PageMarginBox =
  type PagePseudoClass (line 7255) | type PagePseudoClass = "left" | "right" | "first" | "last" | "blank";
  type ParsedComponent (line 7259) | type ParsedComponent =
  type Multiplier (line 7344) | type Multiplier =
  type SyntaxString (line 7357) | type SyntaxString =
  type SyntaxComponentKind (line 7368) | type SyntaxComponentKind =
  type ContainerCondition (line 7421) | type ContainerCondition<D = Declaration> = | {
  type QueryFeatureFor_ContainerSizeFeatureId (line 7455) | type QueryFeatureFor_ContainerSizeFeatureId =
  type MediaFeatureNameFor_ContainerSizeFeatureId (line 7515) | type MediaFeatureNameFor_ContainerSizeFeatureId = ContainerSizeFeatureId...
  type ContainerSizeFeatureId (line 7519) | type ContainerSizeFeatureId = "width" | "height" | "inline-size" | "bloc...
  type StyleQuery (line 7523) | type StyleQuery<D = Declaration> = | {
  type ScrollStateQuery (line 7549) | type ScrollStateQuery =
  type QueryFeatureFor_ScrollStateFeatureId (line 7572) | type QueryFeatureFor_ScrollStateFeatureId =
  type MediaFeatureNameFor_ScrollStateFeatureId (line 7632) | type MediaFeatureNameFor_ScrollStateFeatureId = ScrollStateFeatureId | S...
  type ScrollStateFeatureId (line 7636) | type ScrollStateFeatureId = "stuck" | "snapped" | "scrollable" | "scroll...
  type ViewTransitionProperty (line 7642) | type ViewTransitionProperty =
  type Navigation (line 7658) | type Navigation = "none" | "auto";
  type DefaultAtRule (line 7659) | type DefaultAtRule = null;
  type StyleSheet (line 7678) | interface StyleSheet<D = Declaration, M = MediaQuery> {
  type MediaRule (line 7699) | interface MediaRule<D = Declaration, M = MediaQuery> {
  type Location2 (line 7716) | interface Location2 {
  type MediaList (line 7733) | interface MediaList<M = MediaQuery> {
  type MediaQuery (line 7742) | interface MediaQuery {
  type LengthValue (line 7756) | interface LengthValue {
  type EnvironmentVariable (line 7769) | interface EnvironmentVariable {
  type Url (line 7786) | interface Url {
  type Location (line 7799) | interface Location {
  type Variable (line 7812) | interface Variable {
  type DashedIdentReference (line 7829) | interface DashedIdentReference {
  type Function (line 7842) | interface Function {
  type ImportRule (line 7855) | interface ImportRule<M = MediaQuery> {
  type StyleRule (line 7880) | interface StyleRule<D = Declaration, M = MediaQuery> {
  type DeclarationBlock (line 7903) | interface DeclarationBlock<D = Declaration> {
  type Position (line 7916) | interface Position {
  type WebKitGradientPoint (line 7929) | interface WebKitGradientPoint {
  type WebKitColorStop (line 7942) | interface WebKitColorStop {
  type ImageSet (line 7957) | interface ImageSet {
  type ImageSetOption (line 7970) | interface ImageSetOption {
  type BackgroundPosition (line 7987) | interface BackgroundPosition {
  type BackgroundRepeat (line 8000) | interface BackgroundRepeat {
  type Background (line 8013) | interface Background {
  type BoxShadow (line 8050) | interface BoxShadow {
  type AspectRatio (line 8079) | interface AspectRatio {
  type Overflow (line 8092) | interface Overflow {
  type InsetBlock (line 8105) | interface InsetBlock {
  type InsetInline (line 8118) | interface InsetInline {
  type Inset (line 8131) | interface Inset {
  type BorderRadius (line 8152) | interface BorderRadius {
  type BorderImageRepeat (line 8173) | interface BorderImageRepeat {
  type BorderImageSlice (line 8186) | interface BorderImageSlice {
  type BorderImage (line 8199) | interface BorderImage {
  type BorderColor (line 8224) | interface BorderColor {
  type BorderStyle (line 8245) | interface BorderStyle {
  type BorderWidth (line 8266) | interface BorderWidth {
  type BorderBlockColor (line 8287) | interface BorderBlockColor {
  type BorderBlockStyle (line 8300) | interface BorderBlockStyle {
  type BorderBlockWidth (line 8313) | interface BorderBlockWidth {
  type BorderInlineColor (line 8326) | interface BorderInlineColor {
  type BorderInlineStyle (line 8339) | interface BorderInlineStyle {
  type BorderInlineWidth (line 8352) | interface BorderInlineWidth {
  type GenericBorderFor_LineStyle (line 8365) | interface GenericBorderFor_LineStyle {
  type GenericBorderFor_OutlineStyleAnd_11 (line 8382) | interface GenericBorderFor_OutlineStyleAnd_11 {
  type FlexFlow (line 8399) | interface FlexFlow {
  type Flex (line 8412) | interface Flex {
  type PlaceContent (line 8429) | interface PlaceContent {
  type PlaceSelf (line 8442) | interface PlaceSelf {
  type PlaceItems (line 8455) | interface PlaceItems {
  type Gap (line 8468) | interface Gap {
  type TrackRepeat (line 8483) | interface TrackRepeat {
  type GridAutoFlow (line 8497) | interface GridAutoFlow {
  type GridTemplate (line 8514) | interface GridTemplate {
  type Grid (line 8535) | interface Grid {
  type GridRow (line 8564) | interface GridRow {
  type GridColumn (line 8577) | interface GridColumn {
  type GridArea (line 8590) | interface GridArea {
  type MarginBlock (line 8611) | interface MarginBlock {
  type MarginInline (line 8624) | interface MarginInline {
  type Margin (line 8637) | interface Margin {
  type PaddingBlock (line 8658) | interface PaddingBlock {
  type PaddingInline (line 8671) | interface PaddingInline {
  type Padding (line 8684) | interface Padding {
  type ScrollMarginBlock (line 8705) | interface ScrollMarginBlock {
  type ScrollMarginInline (line 8718) | interface ScrollMarginInline {
  type ScrollMargin (line 8731) | interface ScrollMargin {
  type ScrollPaddingBlock (line 8752) | interface ScrollPaddingBlock {
  type ScrollPaddingInline (line 8765) | interface ScrollPaddingInline {
  type ScrollPadding (line 8778) | interface ScrollPadding {
  type Font (line 8799) | interface Font {
  type Transition (line 8832) | interface Transition {
  type ScrollTimeline (line 8853) | interface ScrollTimeline {
  type ViewTimeline (line 8866) | interface ViewTimeline {
  type AnimationRange (line 8879) | interface AnimationRange {
  type Animation (line 8892) | interface Animation {
  type MatrixForFloat (line 8933) | interface MatrixForFloat {
  type Matrix3DForFloat (line 8944) | interface Matrix3DForFloat {
  type Rotate (line 8965) | interface Rotate {
  type TextTransform (line 8986) | interface TextTransform {
  type TextIndent (line 9003) | interface TextIndent {
  type TextDecoration (line 9020) | interface TextDecoration {
  type TextEmphasis (line 9041) | interface TextEmphasis {
  type TextEmphasisPosition (line 9054) | interface TextEmphasisPosition {
  type TextShadow (line 9067) | interface TextShadow {
  type Cursor (line 9092) | interface Cursor {
  type CursorImage (line 9107) | interface CursorImage {
  type Caret (line 9123) | interface Caret {
  type ListStyle (line 9136) | interface ListStyle {
  type Composes (line 9153) | interface Composes {
  type InsetRect (line 9170) | interface InsetRect {
  type Circle2 (line 9183) | interface Circle2 {
  type Ellipse2 (line 9196) | interface Ellipse2 {
  type Polygon (line 9213) | interface Polygon {
  type Point (line 9228) | interface Point {
  type Mask (line 9241) | interface Mask {
  type MaskBorder (line 9278) | interface MaskBorder {
  type DropShadow (line 9307) | interface DropShadow {
  type Container (line 9328) | interface Container {
  type ColorScheme (line 9338) | interface ColorScheme {
  type UnparsedProperty (line 9348) | interface UnparsedProperty {
  type CustomProperty (line 9361) | interface CustomProperty {
  type AttrOperation (line 9371) | interface AttrOperation {
  type ViewTransitionPartSelector (line 9379) | interface ViewTransitionPartSelector {
  type KeyframesRule (line 9392) | interface KeyframesRule<D = Declaration> {
  type Keyframe (line 9415) | interface Keyframe<D = Declaration> {
  type TimelineRangePercentage (line 9428) | interface TimelineRangePercentage {
  type FontFaceRule (line 9441) | interface FontFaceRule {
  type UrlSource (line 9454) | interface UrlSource {
  type UnicodeRange (line 9473) | interface UnicodeRange {
  type FontPaletteValuesRule (line 9486) | interface FontPaletteValuesRule {
  type OverrideColors (line 9503) | interface OverrideColors {
  type FontFeatureValuesRule (line 9516) | interface FontFeatureValuesRule {
  type FontFeatureSubrule (line 9535) | interface FontFeatureSubrule {
  type PageRule (line 9554) | interface PageRule<D = Declaration> {
  type PageMarginRule (line 9575) | interface PageMarginRule<D = Declaration> {
  type PageSelector (line 9594) | interface PageSelector {
  type SupportsRule (line 9607) | interface SupportsRule<D = Declaration, M = MediaQuery> {
  type CounterStyleRule (line 9624) | interface CounterStyleRule<D = Declaration> {
  type NamespaceRule (line 9641) | interface NamespaceRule {
  type MozDocumentRule (line 9660) | interface MozDocumentRule<D = Declaration, M = MediaQuery> {
  type NestingRule (line 9673) | interface NestingRule<D = Declaration, M = MediaQuery> {
  type NestedDeclarationsRule (line 9686) | interface NestedDeclarationsRule<D = Declaration> {
  type ViewportRule (line 9699) | interface ViewportRule<D = Declaration> {
  type CustomMediaRule (line 9716) | interface CustomMediaRule<M = MediaQuery> {
  type LayerStatementRule (line 9735) | interface LayerStatementRule {
  type LayerBlockRule (line 9748) | interface LayerBlockRule<D = Declaration, M = MediaQuery> {
  type PropertyRule (line 9765) | interface PropertyRule {
  type SyntaxComponent (line 9792) | interface SyntaxComponent {
  type ContainerRule (line 9805) | interface ContainerRule<D = Declaration, M = MediaQuery> {
  type ScopeRule (line 9828) | interface ScopeRule<D = Declaration, M = MediaQuery> {
  type StartingStyleRule (line 9849) | interface StartingStyleRule<D = Declaration, M = MediaQuery> {
  type ViewTransitionRule (line 9862) | interface ViewTransitionRule {
  type UnknownAtRule (line 9875) | interface UnknownAtRule {

FILE: node/browserslistToTargets.js
  constant BROWSER_MAPPING (line 1) | const BROWSER_MAPPING = {
  function browserslistToTargets (line 14) | function browserslistToTargets(browserslist) {
  function parseVersion (line 35) | function parseVersion(version) {

FILE: node/build.rs
  function main (line 4) | fn main() {

FILE: node/composeVisitors.js
  function composeVisitors (line 10) | function composeVisitors(visitors) {
  function wrapCustomAndUnknownAtRule (line 58) | function wrapCustomAndUnknownAtRule(k, f) {
  function wrapCustomProperty (line 68) | function wrapCustomProperty(k, f) {
  function ruleVisitor (line 76) | function ruleVisitor(f, item) {
  function declarationVisitor (line 101) | function declarationVisitor(f, item) {
  function extractObjectsOrFunctions (line 125) | function extractObjectsOrFunctions(visitors, key) {
  function composeObjectVisitors (line 153) | function composeObjectVisitors(res, visitors, key, apply, wrapKey) {
  function composeTokenVisitors (line 184) | function composeTokenVisitors(res, visitors, key, type, isExit) {
  function createTokenVisitor (line 211) | function createTokenVisitor(visitors, type, isExit) {
  function extractFunctions (line 300) | function extractFunctions(visitors, key) {
  function composeSimpleVisitors (line 316) | function composeSimpleVisitors(res, visitors, key) {
  function composeArrayFunctions (line 346) | function composeArrayFunctions(res, visitors, key) {
  function createArrayVisitor (line 367) | function createArrayVisitor(visitors, apply) {
  class Bitset (line 416) | class Bitset {
    method constructor (line 417) | constructor(maxBits = 32) {
    method get (line 423) | get(bit) {
    method set (line 434) | set(bit) {
    method clear (line 444) | clear() {

FILE: node/index.d.ts
  type TransformOptions (line 8) | interface TransformOptions<C extends CustomAtRules> {
  type PropertyStart (line 77) | type PropertyStart = '-' | '_' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g'...
  type ReturnedDeclaration (line 78) | type ReturnedDeclaration = Declaration | {
  type ReturnedMediaQuery (line 85) | type ReturnedMediaQuery = MediaQuery | {
  type FindByType (line 90) | type FindByType<Union, Name> = Union extends { type: Name } ? Union : ne...
  type ReturnedRule (line 91) | type ReturnedRule = Rule<ReturnedDeclaration, ReturnedMediaQuery>;
  type RequiredValue (line 92) | type RequiredValue<Rule> = Rule extends { value: object }
  type RuleVisitor (line 97) | type RuleVisitor<R = RequiredValue<Rule>> = ((rule: R) => ReturnedRule |...
  type MappedRuleVisitors (line 98) | type MappedRuleVisitors = {
  type UnknownVisitors (line 102) | type UnknownVisitors<T> = {
  type CustomVisitors (line 106) | type CustomVisitors<T extends CustomAtRules> = {
  type AnyCustomAtRule (line 110) | type AnyCustomAtRule<C extends CustomAtRules> = {
  type RuleVisitors (line 114) | type RuleVisitors<C extends CustomAtRules> = MappedRuleVisitors & {
  type PreludeTypes (line 119) | type PreludeTypes = Exclude<ParsedComponent['type'], 'literal' | 'repeat...
  type SyntaxString (line 120) | type SyntaxString = `<${PreludeTypes}>` | `<${PreludeTypes}>+` | `<${Pre...
  type ComponentTypes (line 121) | type ComponentTypes = {
  type Repetitions (line 125) | type Repetitions = {
  type MappedPrelude (line 135) | type MappedPrelude = ComponentTypes & Repetitions;
  type MappedBody (line 136) | type MappedBody<P extends CustomAtRuleDefinition['body']> = P extends 's...
  type CustomAtRule (line 137) | interface CustomAtRule<N, R extends CustomAtRuleDefinition> {
  type CustomAtRuleBody (line 144) | type CustomAtRuleBody = {
  type FindProperty (line 152) | type FindProperty<Union, Name> = Union extends { property: Name } ? Unio...
  type DeclarationVisitor (line 153) | type DeclarationVisitor<P = Declaration> = ((property: P) => ReturnedDec...
  type MappedDeclarationVisitors (line 154) | type MappedDeclarationVisitors = {
  type CustomPropertyVisitors (line 158) | type CustomPropertyVisitors = {
  type DeclarationVisitors (line 162) | type DeclarationVisitors = MappedDeclarationVisitors & {
  type RawValue (line 166) | interface RawValue {
  type TokenReturnValue (line 171) | type TokenReturnValue = TokenOrValue | TokenOrValue[] | RawValue | void;
  type TokenVisitor (line 172) | type TokenVisitor = (token: Token) => TokenReturnValue;
  type VisitableTokenTypes (line 173) | type VisitableTokenTypes = 'ident' | 'at-keyword' | 'hash' | 'id-hash' |...
  type TokenVisitors (line 174) | type TokenVisitors = {
  type FunctionVisitor (line 178) | type FunctionVisitor = (fn: Function) => TokenReturnValue;
  type EnvironmentVariableVisitor (line 179) | type EnvironmentVariableVisitor = (env: EnvironmentVariable) => TokenRet...
  type EnvironmentVariableVisitors (line 180) | type EnvironmentVariableVisitors = {
  type Visitor (line 184) | interface Visitor<C extends CustomAtRules> {
  type VisitorDependency (line 216) | type VisitorDependency = FileDependency | GlobDependency;
  type VisitorOptions (line 217) | interface VisitorOptions {
  type VisitorFunction (line 221) | type VisitorFunction<C extends CustomAtRules> = (options: VisitorOptions...
  type CustomAtRules (line 223) | interface CustomAtRules {
  type CustomAtRuleDefinition (line 227) | interface CustomAtRuleDefinition {
  type DependencyOptions (line 247) | interface DependencyOptions {
  type BundleOptions (line 252) | type BundleOptions<C extends CustomAtRules> = Omit<TransformOptions<C>, ...
  type BundleAsyncOptions (line 254) | interface BundleAsyncOptions<C extends CustomAtRules> extends BundleOpti...
  type Resolver (line 259) | interface Resolver {
  type Drafts (line 270) | interface Drafts {
  type NonStandard (line 275) | interface NonStandard {
  type PseudoClasses (line 280) | interface PseudoClasses {
  type TransformResult (line 288) | interface TransformResult {
  type Warning (line 303) | interface Warning {
  type CSSModulesConfig (line 310) | interface CSSModulesConfig {
  type CSSModuleExports (line 327) | type CSSModuleExports = {
  type CSSModuleExport (line 332) | interface CSSModuleExport {
  type CSSModuleReferences (line 341) | type CSSModuleReferences = {
  type CSSModuleReference (line 346) | type CSSModuleReference = LocalCSSModuleReference | GlobalCSSModuleRefer...
  type LocalCSSModuleReference (line 348) | interface LocalCSSModuleReference {
  type GlobalCSSModuleReference (line 354) | interface GlobalCSSModuleReference {
  type DependencyCSSModuleReference (line 360) | interface DependencyCSSModuleReference {
  type Dependency (line 368) | type Dependency = ImportDependency | UrlDependency | FileDependency | Gl...
  type ImportDependency (line 370) | interface ImportDependency {
  type UrlDependency (line 384) | interface UrlDependency {
  type FileDependency (line 394) | interface FileDependency {
  type GlobDependency (line 399) | interface GlobDependency {
  type SourceLocation (line 404) | interface SourceLocation {
  type Location (line 413) | interface Location {
  type ErrorLocation (line 420) | interface ErrorLocation extends Location {
  type TransformAttributeOptions (line 430) | interface TransformAttributeOptions {
  type TransformAttributeResult (line 461) | interface TransformAttributeResult {

FILE: node/index.js
  function wrap (line 31) | function wrap(call) {

FILE: node/src/lib.rs
  function transform (line 9) | fn transform(ctx: CallContext) -> napi::Result<JsUnknown> {
  function transform_style_attribute (line 14) | fn transform_style_attribute(ctx: CallContext) -> napi::Result<JsUnknown> {
  function bundle (line 19) | pub fn bundle(ctx: CallContext) -> napi::Result<JsUnknown> {
  function bundle_async (line 25) | pub fn bundle_async(ctx: CallContext) -> napi::Result<JsObject> {
  function init (line 30) | fn init(mut exports: JsObject) -> napi::Result<()> {
  function register_module (line 44) | pub fn register_module() {
  function napi_wasm_malloc (line 57) | pub extern "C" fn napi_wasm_malloc(size: usize) -> *mut u8 {

FILE: node/targets.d.ts
  type Targets (line 3) | interface Targets {

FILE: node/test/bundle.test.mjs
  method read (line 52) | read(file) {
  method resolve (line 58) | resolve(specifier) {
  method read (line 103) | read(file) {
  method resolve (line 133) | resolve(specifier) {
  method read (line 163) | async read(file) {
  method resolve (line 166) | resolve(specifier) {
  method read (line 197) | read(file) {
  method read (line 217) | async read(file) {
  method read (line 237) | read(file) {
  method read (line 264) | async read(file) {
  method resolve (line 291) | resolve(specifier, originatingFile) {
  method resolve (line 315) | async resolve(specifier, originatingFile) {
  method read (line 339) | read() {
  method resolve (line 358) | resolve() {
  method read (line 382) | read() {
  method Rule (line 405) | Rule() {
  method resolve (line 421) | resolve(specifier, originatingFile) {

FILE: node/test/composeVisitors.test.mjs
  method Length (line 33) | Length(l) {
  method Color (line 43) | Color(c) {
  method Length (line 72) | Length(l) {
  method Length (line 80) | Length(l) {
  method size (line 109) | size(v) {
  method bg (line 121) | bg(v) {
  method size (line 141) | size(v) {
  method width (line 154) | width() {
  method color (line 191) | color(v) {
  method color (line 209) | color(v) {
  method size (line 236) | size() {
  method Length (line 246) | Length(l) {
  method width (line 276) | width(v) {
  method Length (line 287) | Length(l) {
  method width (line 314) | width(v) {
  method width (line 336) | width(v) {
  method Declaration (line 373) | Declaration(decl) {
  method Declaration (line 380) | Declaration(decl) {
  method DeclarationExit (line 404) | DeclarationExit(decl) {
  method DeclarationExit (line 411) | DeclarationExit(decl) {
  method f1 (line 435) | f1(f) {
  method FunctionExit (line 449) | FunctionExit(f) {
  method Length (line 454) | Length(l) {
  method test (line 485) | test(rule) {
  method unknown (line 497) | unknown(rule) {
  method 'at-keyword' (line 503) | 'at-keyword'(token) {
  method testA (line 532) | testA(rule) {
  method testB (line 563) | testB(rule) {
  method style (line 614) | style(rule) {
  method style (line 647) | style(rule) {
  method Variable (line 751) | Variable(v) {
  method Variable (line 758) | Variable(v) {
  method StyleSheet (line 782) | StyleSheet() {
  method StyleSheetExit (line 785) | StyleSheetExit() {
  method StyleSheet (line 790) | StyleSheet() {
  method StyleSheetExit (line 793) | StyleSheetExit() {
  method dep (line 819) | dep(rule) {
  method dep2 (line 833) | dep2(rule) {

FILE: node/test/customAtRules.mjs
  method theme (line 54) | theme(rule) {
  method theme (line 65) | theme(f) {
  method mixin (line 108) | mixin(rule) {
  method apply (line 112) | apply(rule) {
  method breakpoint (line 141) | breakpoint(rule) {
  method breakpoint (line 189) | breakpoint(rule) {
  method custom (line 254) | custom(rule) {
  method mixin (line 302) | mixin(rule) {
  method apply (line 306) | apply(rule) {

FILE: node/test/visitor.test.mjs
  method Length (line 54) | Length(length) {
  method dimension (line 81) | dimension(token) {
  method 'design-token' (line 155) | 'design-token'(fn) {
  method EnvironmentVariable (line 199) | EnvironmentVariable(env) {
  method EnvironmentVariable (line 303) | EnvironmentVariable(env) {
  method Url (line 325) | Url(url) {
  method unknown (line 350) | unknown(rule) {
  method 'at-keyword' (line 356) | 'at-keyword'(token) {
  method Selector (line 379) | Selector(selector) {
  method style (line 406) | style(rule) {
  method style (line 451) | style(rule) {
  method style (line 502) | style(rule) {
  method media (line 541) | media(rule) {
  method style (line 597) | style(style) {
  method style (line 659) | style(style) {
  method media (line 728) | media(media) {
  method size (line 794) | size(property) {
  method Length (line 818) | Length(length) {
  method Length (line 837) | Length(length) {
  method Length (line 856) | Length(length) {
  method DashedIdent (line 881) | DashedIdent(ident) {
  method CustomIdent (line 904) | CustomIdent(ident) {
  method unknown (line 922) | unknown(rule) {
  method Function (line 976) | Function(fn) {
  method theme (line 1009) | theme() {
  method theme (line 1033) | theme() {
  method Rule (line 1053) | Rule(rule) {
  method Selector (line 1072) | Selector(selector) {
  method breakpoints (line 1107) | breakpoints({ body, loc }) {
  method StyleSheetExit (line 1163) | StyleSheetExit(stylesheet) {
  method dep (line 1187) | dep(rule) {
  method Length (line 1213) | Length() {
  method Length (line 1233) | Length() {
  method Length (line 1263) | Length() {

FILE: scripts/build-ast.js
  method parse (line 29) | parse() {
  method Program (line 40) | Program(path) {
  method TSInterfaceDeclaration (line 44) | TSInterfaceDeclaration(path) {
  method ReferencedIdentifier (line 54) | ReferencedIdentifier(path) {
  method TSTypeAliasDeclaration (line 59) | TSTypeAliasDeclaration(path) {
  function process (line 107) | function process(binding) {
  function genericize (line 116) | function genericize(path, name, seen = new Set()) {

FILE: scripts/build-npm.js
  function buildNode (line 108) | function buildNode(triple, cpu, os, libc, t) {
  function buildCLI (line 140) | function buildCLI(triple, cpu, os, libc, t) {

FILE: scripts/build-prefixes.js
  constant BROWSER_MAPPING (line 9) | const BROWSER_MAPPING = {
  constant MDN_BROWSER_MAPPING (line 23) | const MDN_BROWSER_MAPPING = {
  function addValue (line 150) | function addValue(map, value, prop) {
  function parseVersion (line 683) | function parseVersion(version) {

FILE: scripts/build.js
  function build (line 9) | async function build() {
  function setupMacBuild (line 37) | function setupMacBuild() {

FILE: selectors/attr.rs
  type AttrSelectorWithOptionalNamespace (line 10) | pub struct AttrSelectorWithOptionalNamespace<'i, Impl: SelectorImpl<'i>> {
  type Owned (line 29) | type Owned = AttrSelectorWithOptionalNamespace<'any, NewSel>;
  function into_owned (line 31) | fn into_owned(self) -> Self::Owned {
  function namespace (line 43) | pub fn namespace(&self) -> Option<NamespaceConstraint<&Impl::NamespaceUr...
  type NamespaceConstraint (line 63) | pub enum NamespaceConstraint<NamespaceUrl> {
  type ParsedAttrSelectorOperation (line 72) | pub enum ParsedAttrSelectorOperation<AttrValue> {
  type AttrSelectorOperation (line 81) | pub enum AttrSelectorOperation<AttrValue> {
  function eval_str (line 91) | pub fn eval_str(&self, element_attr_value: &str) -> bool
  type AttrSelectorOperator (line 114) | pub enum AttrSelectorOperator {
    method eval_str (line 142) | pub fn eval_str(
  method to_css (line 124) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  type ParsedCaseSensitivity (line 177) | pub enum ParsedCaseSensitivity {
    method to_unconditional (line 195) | pub fn to_unconditional(self, is_html_element_in_html_document: bool) ...
  method default (line 189) | fn default() -> Self {
  type CaseSensitivity (line 212) | pub enum CaseSensitivity {
    method eq (line 218) | pub fn eq(self, a: &[u8], b: &[u8]) -> bool {
    method contains (line 225) | pub fn contains(self, haystack: &str, needle: &str) -> bool {

FILE: selectors/bloom.rs
  constant BLOOM_HASH_MASK (line 12) | pub const BLOOM_HASH_MASK: u32 = 0x00ffffff;
  constant KEY_SIZE (line 13) | const KEY_SIZE: usize = 12;
  constant ARRAY_SIZE (line 15) | const ARRAY_SIZE: usize = 1 << KEY_SIZE;
  constant KEY_MASK (line 16) | const KEY_MASK: u32 = (1 << KEY_SIZE) - 1;
  type BloomFilter (line 19) | pub type BloomFilter = CountingBloomFilter<BloomStorageU8>;
  type CountingBloomFilter (line 68) | pub struct CountingBloomFilter<S>
  function new (line 81) | pub fn new() -> Self {
  function clear (line 86) | pub fn clear(&mut self) {
  function is_zeroed (line 93) | pub fn is_zeroed(&self) -> bool {
  function is_zeroed (line 98) | pub fn is_zeroed(&self) -> bool {
  function insert_hash (line 104) | pub fn insert_hash(&mut self, hash: u32) {
  function remove_hash (line 111) | pub fn remove_hash(&mut self, hash: u32) {
  function might_contain_hash (line 120) | pub fn might_contain_hash(&self, hash: u32) -> bool {
  method fmt (line 129) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  type BloomStorage (line 140) | pub trait BloomStorage: Clone + Default {
    method slot_is_empty (line 141) | fn slot_is_empty(&self, index: usize) -> bool;
    method adjust_slot (line 142) | fn adjust_slot(&mut self, index: usize, increment: bool);
    method is_zeroed (line 143) | fn is_zeroed(&self) -> bool;
    method first_slot_is_empty (line 146) | fn first_slot_is_empty(&self, hash: u32) -> bool {
    method second_slot_is_empty (line 151) | fn second_slot_is_empty(&self, hash: u32) -> bool {
    method adjust_first_slot (line 156) | fn adjust_first_slot(&mut self, hash: u32, increment: bool) {
    method adjust_second_slot (line 161) | fn adjust_second_slot(&mut self, hash: u32, increment: bool) {
    method first_slot_index (line 166) | fn first_slot_index(hash: u32) -> usize {
    method second_slot_index (line 171) | fn second_slot_index(hash: u32) -> usize {
    method adjust_slot (line 183) | fn adjust_slot(&mut self, index: usize, increment: bool) {
    method slot_is_empty (line 196) | fn slot_is_empty(&self, index: usize) -> bool {
    method is_zeroed (line 201) | fn is_zeroed(&self) -> bool {
    method adjust_slot (line 229) | fn adjust_slot(&mut self, index: usize, increment: bool) {
    method slot_is_empty (line 247) | fn slot_is_empty(&self, index: usize) -> bool {
    method is_zeroed (line 253) | fn is_zeroed(&self) -> bool {
  type BloomStorageU8 (line 177) | pub struct BloomStorageU8 {
  method default (line 207) | fn default() -> Self {
  method clone (line 215) | fn clone(&self) -> Self {
  type BloomStorageBool (line 223) | pub struct BloomStorageBool {
  method default (line 259) | fn default() -> Self {
  method clone (line 267) | fn clone(&self) -> Self {
  function hash1 (line 275) | fn hash1(hash: u32) -> u32 {
  function hash2 (line 280) | fn hash2(hash: u32) -> u32 {
  function create_and_insert_some_stuff (line 285) | fn create_and_insert_some_stuff() {
  type HashGenerator (line 344) | struct HashGenerator(u32);
    method next (line 347) | fn next(&mut self) -> u32 {
  function create_insert_1000_remove_100_lookup_100 (line 362) | fn create_insert_1000_remove_100_lookup_100(b: &mut test::Bencher) {
  function might_contain_10 (line 380) | fn might_contain_10(b: &mut test::Bencher) {
  function clear (line 391) | fn clear(b: &mut test::Bencher) {
  function insert_10 (line 397) | fn insert_10(b: &mut test::Bencher) {
  function remove_10 (line 408) | fn remove_10(b: &mut test::Bencher) {

FILE: selectors/build.rs
  function main (line 10) | fn main() {

FILE: selectors/builder.rs
  type SelectorBuilder (line 40) | pub struct SelectorBuilder<'i, Impl: SelectorImpl<'i>> {
  method default (line 56) | fn default() -> Self {
  function push (line 66) | fn push(&mut self, value: Component<'i, Impl>) {
  function push_simple_selector (line 74) | pub fn push_simple_selector(&mut self, ss: Component<'i, Impl>) {
  function push_combinator (line 83) | pub fn push_combinator(&mut self, c: Combinator) {
  function has_combinators (line 90) | pub fn has_combinators(&self) -> bool {
  function add_nesting_prefix (line 94) | pub fn add_nesting_prefix(&mut self) {
  function build (line 101) | pub fn build(
  function build_with_specificity_and_flags (line 125) | pub fn build_with_specificity_and_flags(
  type SelectorBuilderIter (line 149) | struct SelectorBuilderIter<'a, 'i, Impl: SelectorImpl<'i>> {
  method len (line 156) | fn len(&self) -> usize {
  type Item (line 162) | type Item = Component<'i, Impl>;
  method next (line 164) | fn next(&mut self) -> Option<Self::Item> {
  method size_hint (line 180) | fn size_hint(&self) -> (usize, Option<usize>) {
  function split_from_end (line 185) | fn split_from_end<T>(s: &[T], at: usize) -> (&[T], &[T]) {
  type SpecificityAndFlags (line 200) | pub struct SpecificityAndFlags {
    method specificity (line 210) | pub fn specificity(&self) -> u32 {
    method has_pseudo_element (line 215) | pub fn has_pseudo_element(&self) -> bool {
    method is_slotted (line 220) | pub fn is_slotted(&self) -> bool {
    method is_part (line 225) | pub fn is_part(&self) -> bool {
  constant MAX_10BIT (line 230) | const MAX_10BIT: u32 = (1u32 << 10) - 1;
  type Specificity (line 233) | struct Specificity {
    method from (line 259) | fn from(value: u32) -> Specificity {
  type Output (line 239) | type Output = Specificity;
  method add (line 241) | fn add(self, rhs: Self) -> Self::Output {
  method add_assign (line 250) | fn add_assign(&mut self, rhs: Self) {
  function from (line 271) | fn from(specificity: Specificity) -> u32 {
  function specificity (line 278) | fn specificity<'i, Impl>(iter: slice::Iter<Component<'i, Impl>>) -> u32
  function complex_selector_specificity (line 285) | fn complex_selector_specificity<'i, Impl>(iter: slice::Iter<Component<'i...

FILE: selectors/context.rs
  type MatchingMode (line 16) | pub enum MatchingMode {
  type VisitedHandlingMode (line 36) | pub enum VisitedHandlingMode {
    method matches_visited (line 53) | pub fn matches_visited(&self) -> bool {
    method matches_unvisited (line 61) | pub fn matches_unvisited(&self) -> bool {
  type QuirksMode (line 73) | pub enum QuirksMode {
    method classes_and_ids_case_sensitivity (line 84) | pub fn classes_and_ids_case_sensitivity(self) -> CaseSensitivity {
  type MatchingContext (line 95) | pub struct MatchingContext<'a, 'i, Impl>
  function new (line 150) | pub fn new(
  function new_for_visited (line 166) | pub fn new_for_visited(
  function is_nested (line 192) | pub fn is_nested(&self) -> bool {
  function in_negation (line 198) | pub fn in_negation(&self) -> bool {
  function quirks_mode (line 204) | pub fn quirks_mode(&self) -> QuirksMode {
  function matching_mode (line 210) | pub fn matching_mode(&self) -> MatchingMode {
  function classes_and_ids_case_sensitivity (line 216) | pub fn classes_and_ids_case_sensitivity(&self) -> CaseSensitivity {
  function nest (line 222) | pub fn nest<F, R>(&mut self, f: F) -> R
  function nest_for_negation (line 235) | pub fn nest_for_negation<F, R>(&mut self, f: F) -> R
  function visited_handling (line 247) | pub fn visited_handling(&self) -> VisitedHandlingMode {
  function with_visited_handling_mode (line 253) | pub fn with_visited_handling_mode<F, R>(&mut self, handling_mode: Visite...
  function with_shadow_host (line 267) | pub fn with_shadow_host<F, E, R>(&mut self, host: Option<E>, f: F) -> R
  function shadow_host (line 282) | pub fn shadow_host(&self) -> Option<OpaqueElement> {

FILE: selectors/matching.rs
  method for_self (line 49) | pub fn for_self(self) -> ElementSelectorFlags {
  method for_parent (line 54) | pub fn for_parent(self) -> ElementSelectorFlags {
  type LocalMatchingContext (line 63) | struct LocalMatchingContext<'a, 'b, 'i, Impl: SelectorImpl<'i>> {
  function matches_selector_list (line 69) | pub fn matches_selector_list<'i, E>(
  function may_match (line 91) | fn may_match(hashes: &AncestorHashes, bf: &BloomFilter) -> bool {
  type SelectorMatchingResult (line 161) | enum SelectorMatchingResult {
  type MatchesHoverAndActiveQuirk (line 172) | enum MatchesHoverAndActiveQuirk {
  function matches_selector (line 186) | pub fn matches_selector<'i, E, F>(
  type CompoundSelectorMatchingResult (line 212) | pub enum CompoundSelectorMatchingResult {
  function matches_compound_selector_from (line 229) | pub fn matches_compound_selector_from<'i, E>(
  function matches_complex_selector (line 295) | pub fn matches_complex_selector<'i, E, F>(
  function matches_hover_and_active_quirk (line 341) | fn matches_hover_and_active_quirk<'i, Impl: SelectorImpl<'i>>(
  type Rightmost (line 384) | enum Rightmost {
  function next_element_for_combinator (line 390) | fn next_element_for_combinator<'i, E>(
  function matches_complex_selector_internal (line 447) | fn matches_complex_selector_internal<'i, E, F>(
  function matches_local_name (line 550) | fn matches_local_name<'i, E>(element: &E, local_name: &LocalName<'i, E::...
  function matches_compound_selector (line 565) | fn matches_compound_selector<'i, E, F>(
  function matches_simple_selector (line 616) | fn matches_simple_selector<'i, E, F>(
  function select_name (line 821) | fn select_name<'a, T>(is_html: bool, local_name: &'a T, local_name_lower...
  function matches_generic_nth_child (line 830) | fn matches_generic_nth_child<'i, E, F>(
  function nth_child_index (line 886) | fn nth_child_index<'i, E>(
  function matches_first_child (line 945) | fn matches_first_child<'i, E, F>(element: &E, flags_setter: &mut F) -> bool
  function matches_last_child (line 955) | fn matches_last_child<'i, E, F>(element: &E, flags_setter: &mut F) -> bool

FILE: selectors/nth_index_cache.rs
  type NthIndexCache (line 14) | pub struct NthIndexCache {
    method get (line 23) | pub fn get(&mut self, is_of_type: bool, is_from_end: bool) -> &mut Nth...
  type NthIndexCacheInner (line 35) | pub struct NthIndexCacheInner(FxHashMap<OpaqueElement, i32>);
    method lookup (line 39) | pub fn lookup(&mut self, el: OpaqueElement) -> Option<i32> {
    method insert (line 44) | pub fn insert(&mut self, element: OpaqueElement, index: i32) {
    method is_empty (line 49) | pub fn is_empty(&self) -> bool {

FILE: selectors/parser.rs
  type PseudoElement (line 25) | pub trait PseudoElement<'i>: Sized + ToCss {
    method accepts_state_pseudo_classes (line 31) | fn accepts_state_pseudo_classes(&self) -> bool {
    method valid_after_slotted (line 36) | fn valid_after_slotted(&self) -> bool {
    method is_webkit_scrollbar (line 40) | fn is_webkit_scrollbar(&self) -> bool {
    method is_view_transition (line 44) | fn is_view_transition(&self) -> bool {
    method is_unknown (line 48) | fn is_unknown(&self) -> bool {
    type Impl (line 3163) | type Impl = DummySelectorImpl;
    method accepts_state_pseudo_classes (line 3165) | fn accepts_state_pseudo_classes(&self) -> bool {
    method valid_after_slotted (line 3169) | fn valid_after_slotted(&self) -> bool {
  type NonTSPseudoClass (line 54) | pub trait NonTSPseudoClass<'i>: Sized + ToCss {
    method is_active_or_hover (line 59) | fn is_active_or_hover(&self) -> bool;
    method is_user_action_state (line 64) | fn is_user_action_state(&self) -> bool;
    method is_valid_before_webkit_scrollbar (line 66) | fn is_valid_before_webkit_scrollbar(&self) -> bool {
    method is_valid_after_webkit_scrollbar (line 70) | fn is_valid_after_webkit_scrollbar(&self) -> bool {
    method visit (line 74) | fn visit<V>(&self, _visitor: &mut V) -> bool
  function to_ascii_lowercase (line 84) | fn to_ascii_lowercase<'i>(s: CowRcStr<'i>) -> CowRcStr<'i> {
  method allows_pseudos (line 145) | fn allows_pseudos(self) -> bool {
  method allows_slotted (line 151) | fn allows_slotted(self) -> bool {
  method allows_part (line 156) | fn allows_part(self) -> bool {
  method allows_custom_functional_pseudo_classes (line 165) | fn allows_custom_functional_pseudo_classes(self) -> bool {
  method allows_non_functional_pseudo_classes (line 170) | fn allows_non_functional_pseudo_classes(self) -> bool {
  method allows_tree_structural_pseudo_classes (line 175) | fn allows_tree_structural_pseudo_classes(self) -> bool {
  method allows_combinators (line 180) | fn allows_combinators(self) -> bool {
  type SelectorParseError (line 185) | pub type SelectorParseError<'i> = ParseError<'i, SelectorParseErrorKind<...
  type SelectorParseErrorKind (line 188) | pub enum SelectorParseErrorKind<'i> {
  type Parser (line 272) | pub trait Parser<'i> {
    method parse_slotted (line 277) | fn parse_slotted(&self) -> bool {
    method parse_part (line 282) | fn parse_part(&self) -> bool {
    method parse_is_and_where (line 287) | fn parse_is_and_where(&self) -> bool {
    method is_and_where_error_recovery (line 292) | fn is_and_where_error_recovery(&self) -> ParseErrorRecovery {
    method parse_any_prefix (line 297) | fn parse_any_prefix(&self, _name: &str) -> Option<<Self::Impl as Selec...
    method parse_host (line 302) | fn parse_host(&self) -> bool {
    method parse_non_ts_pseudo_class (line 311) | fn parse_non_ts_pseudo_class(
    method parse_non_ts_functional_pseudo_class (line 319) | fn parse_non_ts_functional_pseudo_class<'t>(
    method parse_pseudo_element (line 327) | fn parse_pseudo_element(
    method parse_functional_pseudo_element (line 335) | fn parse_functional_pseudo_element<'t>(
    method default_namespace (line 343) | fn default_namespace(&self) -> Option<<Self::Impl as SelectorImpl<'i>>...
    method namespace_for_prefix (line 347) | fn namespace_for_prefix(
    method is_nesting_allowed (line 354) | fn is_nesting_allowed(&self) -> bool {
    method deep_combinator_enabled (line 358) | fn deep_combinator_enabled(&self) -> bool {
  type SelectorList (line 380) | pub struct SelectorList<'i, Impl: SelectorImpl<'i>>(
  type Owned (line 391) | type Owned = SelectorList<'any, NewSel>;
  function into_owned (line 393) | fn into_owned(self) -> Self::Owned {
  type ParseErrorRecovery (line 399) | pub enum ParseErrorRecovery {
  type NestingRequirement (line 410) | pub enum NestingRequirement {
  function parse (line 422) | pub fn parse<'t, P>(
  function parse_with_state (line 441) | fn parse_with_state<'t, P>(
  function parse_relative (line 484) | pub fn parse_relative<'t, P>(
  function parse_relative_with_state (line 503) | fn parse_relative_with_state<'t, P>(
  function new (line 547) | pub fn new(v: SmallVec<[Selector<'i, Impl>; 1]>) -> Self {
  function from_vec (line 552) | pub fn from_vec(v: Vec<Selector<'i, Impl>>) -> Self {
  function from (line 558) | fn from(selector: Selector<'i, Impl>) -> Self {
  function from (line 564) | fn from(component: Component<'i, Impl>) -> Self {
  function parse_inner_compound_selector (line 570) | fn parse_inner_compound_selector<'i, 't, P, Impl>(
  type AncestorHashes (line 604) | pub struct AncestorHashes {
    method new (line 660) | pub fn new<'i, Impl: SelectorImpl<'i>>(selector: &Selector<'i, Impl>, ...
    method fourth_hash (line 687) | pub fn fourth_hash(&self) -> u32 {
  function collect_ancestor_hashes (line 608) | fn collect_ancestor_hashes<'i, Impl: SelectorImpl<'i>>(
  function namespace_empty_string (line 694) | pub fn namespace_empty_string<'i, Impl: SelectorImpl<'i>>() -> Impl::Nam...
  type Selector (line 714) | pub struct Selector<'i, Impl: SelectorImpl<'i>>(SpecificityAndFlags, Vec...
  type Owned (line 723) | type Owned = Selector<'any, NewSel>;
  function into_owned (line 725) | fn into_owned(self) -> Self::Owned {
  function specificity (line 732) | pub fn specificity(&self) -> u32 {
  function has_pseudo_element (line 737) | pub fn has_pseudo_element(&self) -> bool {
  function is_slotted (line 742) | pub fn is_slotted(&self) -> bool {
  function is_part (line 747) | pub fn is_part(&self) -> bool {
  function append (line 752) | pub fn append(&mut self, component: Component<'i, Impl>) {
  function parts (line 762) | pub fn parts(&self) -> Option<&[Impl::Identifier]> {
  function pseudo_element (line 787) | pub fn pseudo_element(&self) -> Option<&Impl::PseudoElement> {
  function is_universal (line 806) | pub fn is_universal(&self) -> bool {
  function has_combinator (line 819) | pub fn has_combinator(&self) -> bool {
  function iter (line 829) | pub fn iter(&self) -> SelectorIter<'_, 'i, Impl> {
  function is_featureless_host_selector_or_pseudo_element (line 840) | pub fn is_featureless_host_selector_or_pseudo_element(&self) -> bool {
  function iter_from (line 862) | pub fn iter_from(&self, offset: usize) -> SelectorIter<'_, 'i, Impl> {
  function combinator_at_match_order (line 873) | pub fn combinator_at_match_order(&self, index: usize) -> Combinator {
  function iter_raw_match_order (line 883) | pub fn iter_raw_match_order(&self) -> slice::Iter<'_, Component<'i, Impl...
  function iter_mut_raw_match_order (line 888) | pub fn iter_mut_raw_match_order(&mut self) -> slice::IterMut<'_, Compone...
  function combinator_at_parse_order (line 895) | pub fn combinator_at_parse_order(&self, index: usize) -> Combinator {
  function iter_raw_parse_order_from (line 906) | pub fn iter_raw_parse_order_from(&self, offset: usize) -> Rev<slice::Ite...
  function from_vec (line 912) | pub(crate) fn from_vec(vec: Vec<Component<'i, Impl>>, specificity: u32, ...
  function new (line 928) | pub(crate) fn new(spec: SpecificityAndFlags, components: Vec<Component<'...
  function len (line 934) | pub fn len(&self) -> usize {
  function visit (line 956) | pub fn visit<V>(&self, visitor: &mut V) -> bool
  function from (line 984) | fn from(component: Component<'i, Impl>) -> Self {
  function from (line 997) | fn from(vec: Vec<Component<'i, Impl>>) -> Self {
  type SelectorIter (line 1012) | pub struct SelectorIter<'a, 'i, Impl: SelectorImpl<'i>> {
  function next_sequence (line 1021) | pub fn next_sequence(&mut self) -> Option<Combinator> {
  function is_featureless_host_selector (line 1028) | pub(crate) fn is_featureless_host_selector(&mut self) -> bool {
  function matches_for_stateless_pseudo_element (line 1035) | pub(crate) fn matches_for_stateless_pseudo_element(&mut self) -> bool {
  function matches_for_stateless_pseudo_element_internal (line 1046) | fn matches_for_stateless_pseudo_element_internal(&mut self, first: &Comp...
  function selector_length (line 1063) | pub fn selector_length(&self) -> usize {
  type Item (line 1069) | type Item = &'a Component<'i, Impl>;
  method next (line 1072) | fn next(&mut self) -> Option<Self::Item> {
  function fmt (line 1085) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  type AncestorIter (line 1095) | struct AncestorIter<'a, 'i, Impl: SelectorImpl<'i>>(SelectorIter<'a, 'i,...
  function new (line 1099) | fn new(inner: SelectorIter<'a, 'i, Impl>) -> Self {
  function skip_until_ancestor (line 1107) | fn skip_until_ancestor(&mut self) {
  type Item (line 1125) | type Item = &'a Component<'i, Impl>;
  method next (line 1126) | fn next(&mut self) -> Option<Self::Item> {
  type Combinator (line 1152) | pub enum Combinator {
    method is_ancestor (line 1184) | pub fn is_ancestor(&self) -> bool {
    method is_pseudo_element (line 1193) | pub fn is_pseudo_element(&self) -> bool {
    method is_sibling (line 1199) | pub fn is_sibling(&self) -> bool {
    method is_tree_combinator (line 1204) | pub fn is_tree_combinator(&self) -> bool {
  type NthType (line 1215) | pub enum NthType {
    method is_only (line 1227) | pub fn is_only(self) -> bool {
    method is_of_type (line 1231) | pub fn is_of_type(self) -> bool {
    method is_from_end (line 1235) | pub fn is_from_end(self) -> bool {
    method allows_of_selector (line 1239) | pub fn allows_of_selector(self) -> bool {
  type NthSelectorData (line 1249) | pub struct NthSelectorData {
    method only (line 1259) | pub const fn only(of_type: bool) -> Self {
    method first (line 1274) | pub const fn first(of_type: bool) -> Self {
    method last (line 1285) | pub const fn last(of_type: bool) -> Self {
    method is_function (line 1299) | pub fn is_function(&self) -> bool {
    method write_start (line 1305) | pub fn write_start<W: fmt::Write>(&self, dest: &mut W, is_function: bo...
    method write_affine (line 1325) | pub fn write_affine<W: fmt::Write>(&self, dest: &mut W) -> fmt::Result {
  type NthOfSelectorData (line 1347) | pub struct NthOfSelectorData<'i, Impl: SelectorImpl<'i>>(NthSelectorData...
  type Owned (line 1356) | type Owned = NthOfSelectorData<'any, NewSel>;
  function into_owned (line 1358) | fn into_owned(self) -> Self::Owned {
  function new (line 1366) | pub fn new(nth_data: NthSelectorData, selectors: Box<[Selector<'i, Impl>...
  function nth_data (line 1372) | pub fn nth_data(&self) -> &NthSelectorData {
  function selectors (line 1378) | pub fn selectors(&self) -> &[Selector<'i, Impl>] {
  function clone_selectors (line 1382) | pub fn clone_selectors(&self) -> Box<[Selector<'i, Impl>]> {
  type Component (line 1392) | pub enum Component<'i, Impl: SelectorImpl<'i>> {
  type Owned (line 1496) | type Owned = Component<'any, NewSel>;
  function into_owned (line 1498) | fn into_owned(self) -> Self::Owned {
  function is_combinator (line 1555) | pub fn is_combinator(&self) -> bool {
  function as_combinator (line 1560) | pub fn as_combinator(&self) -> Option<Combinator> {
  function maybe_allowed_after_pseudo_element (line 1569) | pub fn maybe_allowed_after_pseudo_element(&self) -> bool {
  function matches_for_stateless_pseudo_element (line 1587) | fn matches_for_stateless_pseudo_element(&self) -> bool {
  function visit (line 1608) | pub fn visit<V>(&self, visitor: &mut V) -> bool
  type LocalName (line 1695) | pub struct LocalName<'i, Impl: SelectorImpl<'i>> {
  type Owned (line 1707) | type Owned = LocalName<'any, NewSel>;
  function into_owned (line 1709) | fn into_owned(self) -> Self::Owned {
  method fmt (line 1718) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  method fmt (line 1726) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  method fmt (line 1731) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  method fmt (line 1736) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
  function serialize (line 1746) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  function deserialize (line 1759) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  function serialize_selector_list (line 1769) | fn serialize_selector_list<'a, 'i: 'a, Impl, I, W>(iter: I, dest: &mut W...
  method to_css (line 1787) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  function fmt (line 1796) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> fmt::Result {
  method to_css (line 1802) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  method to_css (line 1916) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  method to_css (line 1933) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  method to_css (line 2066) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  method to_css (line 2102) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  function parse_selector (line 2114) | fn parse_selector<'i, 't, P, Impl>(
  function parse (line 2244) | pub fn parse<'t, P>(parser: &P, input: &mut CssParser<'i, 't>) -> Result...
  function parse_relative_selector (line 2257) | fn parse_relative_selector<'i, 't, P, Impl>(
  function parse_type_selector (line 2302) | fn parse_type_selector<'i, 't, P, Impl, S>(
  type SimpleSelectorParseResult (line 2364) | enum SimpleSelectorParseResult<'i, Impl: SelectorImpl<'i>> {
  type QNamePrefix (line 2372) | enum QNamePrefix<'i, Impl: SelectorImpl<'i>> {
  type OptionalQName (line 2381) | enum OptionalQName<'i, Impl: SelectorImpl<'i>> {
  function parse_qualified_name (line 2390) | fn parse_qualified_name<'i, 't, P, Impl>(
  function parse_attribute_selector (line 2481) | fn parse_attribute_selector<'i, 't, P, Impl>(
  type AttributeFlags (line 2611) | enum AttributeFlags {
    method to_case_sensitivity (line 2621) | fn to_case_sensitivity(self, local_name: &str, have_namespace: bool) -...
  function parse_attribute_flags (line 2638) | fn parse_attribute_flags<'i, 't>(input: &mut CssParser<'i, 't>) -> Resul...
  function parse_negation (line 2664) | fn parse_negation<'i, 't, P, Impl>(
  function parse_compound_selector (line 2696) | fn parse_compound_selector<'i, 't, P, Impl>(
  function parse_is_or_where (line 2801) | fn parse_is_or_where<'i, 't, P, Impl>(
  function parse_has (line 2832) | fn parse_has<'i, 't, P, Impl>(
  function parse_functional_pseudo_class (line 2855) | fn parse_functional_pseudo_class<'i, 't, P, Impl>(
  function parse_nth_pseudo_class (line 2898) | fn parse_nth_pseudo_class<'i, 't, P, Impl>(
  function is_css2_pseudo_element (line 2946) | fn is_css2_pseudo_element(name: &str) -> bool {
  function parse_one_simple_selector (line 2959) | fn parse_one_simple_selector<'i, 't, P, Impl>(
  function parse_simple_pseudo_class (line 3085) | fn parse_simple_pseudo_class<'i, P, Impl>(
  type PseudoClass (line 3150) | pub enum PseudoClass {
    type Impl (line 3175) | type Impl = DummySelectorImpl;
    method is_active_or_hover (line 3178) | fn is_active_or_hover(&self) -> bool {
    method is_user_action_state (line 3183) | fn is_user_action_state(&self) -> bool {
  type PseudoElement (line 3157) | pub enum PseudoElement {
    method accepts_state_pseudo_classes (line 31) | fn accepts_state_pseudo_classes(&self) -> bool {
    method valid_after_slotted (line 36) | fn valid_after_slotted(&self) -> bool {
    method is_webkit_scrollbar (line 40) | fn is_webkit_scrollbar(&self) -> bool {
    method is_view_transition (line 44) | fn is_view_transition(&self) -> bool {
    method is_unknown (line 48) | fn is_unknown(&self) -> bool {
    type Impl (line 3163) | type Impl = DummySelectorImpl;
    method accepts_state_pseudo_classes (line 3165) | fn accepts_state_pseudo_classes(&self) -> bool {
    method valid_after_slotted (line 3169) | fn valid_after_slotted(&self) -> bool {
  method to_css (line 3189) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  method to_css (line 3206) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  type DummySelectorImpl (line 3218) | pub struct DummySelectorImpl;
    type ExtraMatchingData (line 3236) | type ExtraMatchingData = ();
    type AttrValue (line 3237) | type AttrValue = DummyAttrValue;
    type Identifier (line 3238) | type Identifier = DummyAtom;
    type LocalName (line 3239) | type LocalName = DummyAtom;
    type NamespaceUrl (line 3240) | type NamespaceUrl = DummyAtom;
    type NamespacePrefix (line 3241) | type NamespacePrefix = DummyAtom;
    type BorrowedLocalName (line 3242) | type BorrowedLocalName = DummyAtom;
    type BorrowedNamespaceUrl (line 3243) | type BorrowedNamespaceUrl = DummyAtom;
    type NonTSPseudoClass (line 3244) | type NonTSPseudoClass = PseudoClass;
    type PseudoElement (line 3245) | type PseudoElement = PseudoElement;
    type VendorPrefix (line 3246) | type VendorPrefix = u8;
  type DummyParser (line 3221) | pub struct DummyParser {
    method default_with_namespace (line 3227) | fn default_with_namespace(default_ns: DummyAtom) -> DummyParser {
    type Impl (line 3328) | type Impl = DummySelectorImpl;
    type Error (line 3329) | type Error = SelectorParseErrorKind<'i>;
    method parse_slotted (line 3331) | fn parse_slotted(&self) -> bool {
    method parse_is_and_where (line 3335) | fn parse_is_and_where(&self) -> bool {
    method is_and_where_error_recovery (line 3339) | fn is_and_where_error_recovery(&self) -> ParseErrorRecovery {
    method parse_part (line 3343) | fn parse_part(&self) -> bool {
    method parse_non_ts_pseudo_class (line 3347) | fn parse_non_ts_pseudo_class(
    method parse_non_ts_functional_pseudo_class (line 3360) | fn parse_non_ts_functional_pseudo_class<'t>(
    method parse_pseudo_element (line 3375) | fn parse_pseudo_element(
    method default_namespace (line 3388) | fn default_namespace(&self) -> Option<DummyAtom> {
    method namespace_for_prefix (line 3392) | fn namespace_for_prefix(&self, prefix: &DummyAtom) -> Option<DummyAtom> {
  type DummyAttrValue (line 3250) | pub struct DummyAttrValue(String);
    method as_ref (line 3262) | fn as_ref(&self) -> &str {
    method from (line 3268) | fn from(string: &'a str) -> Self {
    method from (line 3274) | fn from(string: std::borrow::Cow<'a, str>) -> Self {
    method from (line 3280) | fn from(string: CowRcStr<'a>) -> Self {
  method to_css (line 3253) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  type DummyAtom (line 3286) | pub struct DummyAtom(String);
    method from (line 3298) | fn from(string: String) -> Self {
    method from (line 3304) | fn from(string: &'a str) -> Self {
    method from (line 3310) | fn from(string: CowRcStr<'a>) -> Self {
    method as_ref (line 3316) | fn as_ref(&self) -> &str {
    method from (line 3322) | fn from(string: std::borrow::Cow<'a, str>) -> Self {
  method to_css (line 3289) | fn to_css<W>(&self, dest: &mut W) -> fmt::Result
  function parse (line 3397) | fn parse<'i>(input: &'i str) -> Result<SelectorList<'i, DummySelectorImp...
  function parse_ns (line 3408) | fn parse_ns<'i>(
  function parse_ns_expected (line 3415) | fn parse_ns_expected<'i, 'a>(
  function specificity (line 3443) | fn specificity(a: u32, b: u32, c: u32) -> u32 {
  function test_empty (line 3448) | fn test_empty() {
  constant MATHML (line 3459) | const MATHML: &str = "http://www.w3.org/1998/Math/MathML";
  constant SVG (line 3460) | const SVG: &str = "http://www.w3.org/2000/svg";
  function test_parsing (line 3463) | fn test_parsing() {
  function test_pseudo_iter (line 3953) | fn test_pseudo_iter() {
  function test_universal (line 3967) | fn test_universal() {
  function test_empty_pseudo_iter (line 3978) | fn test_empty_pseudo_iter() {
  type TestVisitor (line 3989) | struct TestVisitor {
    type Impl (line 3994) | type Impl = DummySelectorImpl;
    method visit_simple_selector (line 3996) | fn visit_simple_selector(&mut self, s: &Component<DummySelectorImpl>) ...
  function visitor (line 4005) | fn visitor() {

FILE: selectors/serialization.rs
  type SerializedComponent (line 26) | enum SerializedComponent<'i, 's, Impl: SelectorImpl<'s>, PseudoClass, Ps...
  type Namespace (line 66) | enum Namespace<'i> {
  type TSPseudoClass (line 82) | enum TSPseudoClass<'s, Impl: SelectorImpl<'s>, VendorPrefix> {
  type SerializedPseudoClass (line 206) | enum SerializedPseudoClass<'s, Impl: SelectorImpl<'s>, PseudoClass, Vend...
  type BuiltinPseudoElement (line 228) | enum BuiltinPseudoElement<'i, 's, Impl: SelectorImpl<'s>> {
  type SerializedPseudoElement (line 254) | enum SerializedPseudoElement<'i, 's, Impl: SelectorImpl<'s>, PseudoEleme...
  type AttrSelector (line 268) | struct AttrSelector<'i> {
  type NamespaceValue (line 277) | struct NamespaceValue<'i> {
  type AttrOperation (line 285) | struct AttrOperation<'i> {
  function serialize (line 298) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  function serialize_nth (line 406) | fn serialize_nth<'i, 's, Impl: SelectorImpl<'s>>(
  function deserialize (line 459) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  function serialize (line 612) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  function deserialize (line 659) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  function is_referenceable (line 719) | fn is_referenceable() -> bool {
  function json_schema (line 723) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  function schema_name (line 727) | fn schema_name() -> String {

FILE: selectors/sink.rs
  type Push (line 16) | pub trait Push<T> {
    method push (line 18) | fn push(&mut self, value: T);
  function push (line 22) | fn push(&mut self, value: T) {
  function push (line 28) | fn push(&mut self, value: A::Item) {

FILE: selectors/tree.rs
  type OpaqueElement (line 16) | pub struct OpaqueElement(NonNull<()>);
    method new (line 22) | pub fn new<T>(ptr: &T) -> Self {
  type Element (line 27) | pub trait Element<'i>: Sized + Clone + Debug {
    method opaque (line 31) | fn opaque(&self) -> OpaqueElement;
    method parent_element (line 33) | fn parent_element(&self) -> Option<Self>;
    method parent_node_is_shadow_root (line 36) | fn parent_node_is_shadow_root(&self) -> bool;
    method containing_shadow_host (line 39) | fn containing_shadow_host(&self) -> Option<Self>;
    method pseudo_element_originating_element (line 45) | fn pseudo_element_originating_element(&self) -> Option<Self> {
    method is_pseudo_element (line 51) | fn is_pseudo_element(&self) -> bool;
    method prev_sibling_element (line 54) | fn prev_sibling_element(&self) -> Option<Self>;
    method next_sibling_element (line 57) | fn next_sibling_element(&self) -> Option<Self>;
    method is_html_element_in_html_document (line 59) | fn is_html_element_in_html_document(&self) -> bool;
    method has_local_name (line 61) | fn has_local_name(&self, local_name: &<Self::Impl as SelectorImpl<'i>>...
    method has_namespace (line 64) | fn has_namespace(&self, ns: &<Self::Impl as SelectorImpl<'i>>::Borrowe...
    method is_same_type (line 67) | fn is_same_type(&self, other: &Self) -> bool;
    method attr_matches (line 69) | fn attr_matches(
    method match_non_ts_pseudo_class (line 76) | fn match_non_ts_pseudo_class<F>(
    method match_pseudo_element (line 85) | fn match_pseudo_element(
    method is_link (line 92) | fn is_link(&self) -> bool;
    method is_html_slot_element (line 95) | fn is_html_slot_element(&self) -> bool;
    method assigned_slot (line 100) | fn assigned_slot(&self) -> Option<Self> {
    method has_id (line 104) | fn has_id(&self, id: &<Self::Impl as SelectorImpl<'i>>::Identifier, ca...
    method has_class (line 106) | fn has_class(
    method imported_part (line 114) | fn imported_part(
    method is_part (line 119) | fn is_part(&self, name: &<Self::Impl as SelectorImpl<'i>>::Identifier)...
    method is_empty (line 125) | fn is_empty(&self) -> bool;
    method is_root (line 132) | fn is_root(&self) -> bool;
    method ignores_nth_child_selectors (line 136) | fn ignores_nth_child_selectors(&self) -> bool {

FILE: selectors/visitor.rs
  type SelectorVisitor (line 16) | pub trait SelectorVisitor<'i>: Sized {
    method visit_attribute_selector (line 23) | fn visit_attribute_selector(
    method visit_simple_selector (line 33) | fn visit_simple_selector(&mut self, _: &Component<'i, Self::Impl>) -> ...
    method visit_selector_list (line 41) | fn visit_selector_list(&mut self, list: &[Selector<'i, Self::Impl>]) -...
    method visit_complex_selector (line 54) | fn visit_complex_selector(&mut self, _combinator_to_right: Option<Comb...

FILE: src/bundler.rs
  type Bundler (line 66) | pub struct Bundler<'a, 'o, 's, P, T: AtRuleParser<'a>> {
  type AtRuleParserValue (line 75) | enum AtRuleParserValue<'a, T> {
  type BundleStyleSheet (line 80) | struct BundleStyleSheet<'i, 'o, T> {
  type Dependency (line 93) | enum Dependency {
  type ResolveResult (line 105) | pub enum ResolveResult {
    method from (line 114) | fn from(path: PathBuf) -> Self {
  type SourceProvider (line 123) | pub trait SourceProvider: Send + Sync {
    method read (line 128) | fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error>;
    method resolve (line 132) | fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<...
    type Error (line 154) | type Error = std::io::Error;
    method read (line 156) | fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
    method resolve (line 166) | fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<...
    type Error (line 897) | type Error = std::io::Error;
    method read (line 899) | fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
    method resolve (line 903) | fn resolve(&self, specifier: &str, originating_file: &Path) -> Result<...
    type Error (line 918) | type Error = std::io::Error;
    method read (line 921) | fn read<'a>(&'a self, file: &Path) -> Result<&'a str, Self::Error> {
    method resolve (line 927) | fn resolve(&self, specifier: &str, _originating_file: &Path) -> Result...
  type FileProvider (line 137) | pub struct FileProvider {
    method new (line 143) | pub fn new() -> FileProvider {
  method drop (line 173) | fn drop(&mut self) {
  type BundleErrorKind (line 183) | pub enum BundleErrorKind<'i, T: std::error::Error> {
  function from (line 202) | fn from(err: Error<ParserError<'i>>) -> Self {
  function fmt (line 211) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function reason (line 233) | pub fn reason(&self) -> String {
  function new (line 242) | pub fn new(
  function new_with_at_rule_parser (line 265) | pub fn new_with_at_rule_parser(
  function bundle (line 282) | pub fn bundle<'e>(
  function find_filename (line 355) | fn find_filename(&self, source_index: u32) -> String {
  function load_file (line 361) | fn load_file(&self, file: &Path, rule: ImportRule<'a>) -> Result<u32, Er...
  function add_css_module_dep (line 615) | fn add_css_module_dep(
  function order (line 668) | fn order(&mut self) {
  function inline (line 713) | fn inline(
  function combine_supports (line 823) | fn combine_supports<'a>(
  function visit_vars (line 837) | fn visit_vars<'a, 'b>(
  type TestProvider (line 892) | struct TestProvider {
  type CustomProvider (line 913) | struct CustomProvider {
  function bundle (line 957) | fn bundle<P: SourceProvider>(fs: P, entry: &str) -> String {
  function bundle_css_module (line 963) | fn bundle_css_module<P: SourceProvider>(
  function bundle_css_module_with_pattern (line 971) | fn bundle_css_module_with_pattern<P: SourceProvider>(
  function bundle_custom_media (line 1000) | fn bundle_custom_media<P: SourceProvider>(fs: P, entry: &str) -> String {
  function error_test (line 1032) | fn error_test<P: SourceProvider>(
  function flatten_exports (line 1049) | fn flatten_exports(exports: CssModuleExports) -> HashMap<String, String> {
  function test_bundle (line 1067) | fn test_bundle() {
  function test_css_module (line 1905) | fn test_css_module() {
  function test_source_map (line 2164) | fn test_source_map() {
  function test_license_comments (line 2209) | fn test_license_comments() {

FILE: src/compat.rs
  type Feature (line 7) | pub enum Feature {
    method is_compatible (line 234) | pub fn is_compatible(&self, browsers: Browsers) -> bool {
    method is_partially_compatible (line 5774) | pub fn is_partially_compatible(&self, targets: Browsers) -> bool {

FILE: src/context.rs
  type SupportsEntry (line 21) | pub(crate) struct SupportsEntry<'i> {
  type DeclarationContext (line 28) | pub(crate) enum DeclarationContext {
  type PropertyHandlerContext (line 36) | pub(crate) struct PropertyHandlerContext<'i, 'o> {
  function new (line 48) | pub fn new(targets: Targets, unused_symbols: &'o HashSet<String>) -> Self {
  function child (line 61) | pub fn child(&self, context: DeclarationContext) -> Self {
  function should_compile_logical (line 74) | pub fn should_compile_logical(&self, feature: Feature) -> bool {
  function add_logical_rule (line 84) | pub fn add_logical_rule(&mut self, ltr: Property<'i>, rtl: Property<'i>) {
  function add_dark_rule (line 89) | pub fn add_dark_rule(&mut self, property: Property<'i>) {
  function get_additional_rules (line 93) | pub fn get_additional_rules<T>(&self, style_rule: &StyleRule<'i, T>) -> ...
  function add_conditional_property (line 158) | pub fn add_conditional_property(&mut self, condition: SupportsCondition<...
  function add_unparsed_fallbacks (line 185) | pub fn add_unparsed_fallbacks(&mut self, unparsed: &mut UnparsedProperty...
  function get_supports_rules (line 202) | pub fn get_supports_rules<T>(&self, style_rule: &StyleRule<'i, T>) -> Ve...
  function reset (line 228) | pub fn reset(&mut self) {

FILE: src/css_modules.rs
  type Config (line 29) | pub struct Config<'i> {
  method default (line 52) | fn default() -> Self {
  type Pattern (line 67) | pub struct Pattern<'i> {
  method default (line 73) | fn default() -> Self {
  type PatternParseError (line 82) | pub enum PatternParseError {
    method fmt (line 90) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
  function parse (line 107) | pub fn parse(mut input: &'i str) -> Result<Self, PatternParseError> {
  function has_content_hash (line 138) | pub fn has_content_hash(&self) -> bool {
  function write (line 143) | pub fn write<W, E>(
  function write_to_string (line 182) | fn write_to_string(
  type Segment (line 199) | pub enum Segment<'i> {
  type CssModuleReference (line 221) | pub enum CssModuleReference {
  type CssModuleExport (line 245) | pub struct CssModuleExport {
  type CssModuleExports (line 255) | pub type CssModuleExports = HashMap<String, CssModuleExport>;
  type CssModuleReferences (line 258) | pub type CssModuleReferences = HashMap<String, CssModuleReference>;
  type CssModule (line 270) | pub(crate) struct CssModule<'a, 'b, 'c> {
  function new (line 280) | pub fn new(
  function add_local (line 315) | pub fn add_local(&mut self, exported: &str, local: &str, source_index: u...
  function add_dashed (line 339) | pub fn add_dashed(&mut self, local: &str, source_index: u32) {
  function reference (line 363) | pub fn reference(&mut self, name: &str, source_index: u32) {
  function reference_dashed (line 392) | pub fn reference_dashed(&mut self, name: &str, from: &Option<Specifier>,...
  function handle_composes (line 463) | pub fn handle_composes(
  function hash (line 537) | pub(crate) fn hash(s: &str, at_start: bool) -> String {

FILE: src/declaration.rs
  type DeclarationBlock (line 61) | pub struct DeclarationBlock<'i> {
  function parse (line 72) | pub fn parse<'a, 'o, 't>(
  function parse_string (line 101) | pub fn parse_string<'o>(
  function new (line 113) | pub fn new() -> Self {
  function len (line 121) | pub fn len(&self) -> usize {
  method to_css (line 127) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function to_css_block (line 155) | pub fn to_css_block<W>(&self, dest: &mut Printer<W>) -> Result<(), Print...
  function has_printable_declarations (line 171) | pub(crate) fn has_printable_declarations(&self) -> bool {
  function to_css_declarations (line 186) | pub fn to_css_declarations<W>(
  function minify (line 238) | pub(crate) fn minify(
  function is_empty (line 267) | pub fn is_empty(&self) -> bool {
  function property_location (line 271) | pub(crate) fn property_location<'t>(
  function iter (line 311) | pub fn iter(&self) -> impl std::iter::DoubleEndedIterator<Item = (&Prope...
  function iter_mut (line 320) | pub fn iter_mut(&mut self) -> impl std::iter::DoubleEndedIterator<Item =...
  function get (line 329) | pub fn get<'a>(&'a self, property_id: &PropertyId) -> Option<(Cow<'a, Pr...
  function set (line 354) | pub fn set(&mut self, property: Property<'i>, important: bool) {
  function remove (line 407) | pub fn remove(&mut self, property_id: &PropertyId) {
  type PropertyDeclarationParser (line 459) | struct PropertyDeclarationParser<'a, 'o, 'i> {
  type Declaration (line 467) | type Declaration = ();
  type Error (line 468) | type Error = ParserError<'i>;
  function parse_value (line 470) | fn parse_value<'t>(
  type Prelude (line 487) | type Prelude = ();
  type AtRule (line 488) | type AtRule = ();
  type Error (line 489) | type Error = ParserError<'i>;
  type Prelude (line 493) | type Prelude = ();
  type QualifiedRule (line 494) | type QualifiedRule = ();
  type Error (line 495) | type Error = ParserError<'i>;
  function parse_qualified (line 499) | fn parse_qualified(&self) -> bool {
  function parse_declarations (line 503) | fn parse_declarations(&self) -> bool {
  function parse_declaration (line 508) | pub(crate) fn parse_declaration<'i, 't>(
  type DeclarationList (line 539) | pub(crate) type DeclarationList<'i> = Vec<Property<'i>>;
  type DeclarationHandler (line 542) | pub(crate) struct DeclarationHandler<'i> {
  function handle_property (line 577) | pub fn handle_property(
  function handle_custom_property (line 613) | fn handle_custom_property(
  function handle_all (line 645) | fn handle_all(&mut self, property: &Property<'i>) -> bool {
  function add_conditional_fallbacks (line 675) | fn add_conditional_fallbacks(
  function finalize (line 694) | pub fn finalize(&mut self, context: &mut PropertyHandlerContext<'i, '_>) {

FILE: src/dependencies.rs
  type DependencyOptions (line 24) | pub struct DependencyOptions {
  type Dependency (line 36) | pub enum Dependency {
  type ImportDependency (line 46) | pub struct ImportDependency {
    method new (line 61) | pub fn new(rule: &ImportRule, filename: &str) -> ImportDependency {
  type UrlDependency (line 99) | pub struct UrlDependency {
    method new (line 110) | pub fn new(url: &Url, filename: &str) -> UrlDependency {
  type SourceRange (line 124) | pub struct SourceRange {
    method new (line 157) | fn new(filename: &str, loc: Location, offset: u32, len: usize) -> Sour...
  type Location (line 140) | pub struct Location {
    method from (line 148) | fn from(loc: SourceLocation) -> Location {

FILE: src/error.rs
  type Error (line 19) | pub struct Error<T> {
  function fmt (line 27) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type ErrorLocation (line 43) | pub struct ErrorLocation {
    method new (line 54) | pub fn new(loc: Location, filename: String) -> Self {
    method fmt (line 64) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type ParserError (line 74) | pub enum ParserError<'i> {
  function fmt (line 114) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 147) | pub fn from(err: ParseError<'i, ParserError<'i>>, filename: String) -> E...
  function into_owned (line 171) | pub fn into_owned<'x>(self) -> Error<ParserError<'static>> {
  function from (line 180) | fn from(err: SelectorParseErrorKind<'i>) -> ParserError<'i> {
  function reason (line 188) | pub fn reason(&self) -> String {
  type SelectorError (line 198) | pub enum SelectorError<'i> {
  function fmt (line 256) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  function from (line 291) | fn from(err: SelectorParseErrorKind<'i>) -> Self {
  type ErrorWithLocation (line 334) | pub(crate) struct ErrorWithLocation<T> {
  function fmt (line 340) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
  type MinifyError (line 347) | pub(crate) type MinifyError = ErrorWithLocation<MinifyErrorKind>;
  type MinifyErrorKind (line 353) | pub enum MinifyErrorKind {
    method fmt (line 374) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
    method reason (line 394) | pub fn reason(&self) -> String {
  type PrinterError (line 400) | pub type PrinterError = Error<PrinterErrorKind>;
    method from (line 423) | fn from(_: fmt::Error) -> PrinterError {
  type PrinterErrorKind (line 406) | pub enum PrinterErrorKind {
    method fmt (line 432) | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
    method reason (line 447) | pub fn reason(&self) -> String {

FILE: src/lib.rs
  function test (line 76) | fn test(source: &str, expected: &str) {
  function test_with_options (line 81) | fn test_with_options<'i, 'o>(source: &'i str, expected: &'i str, options...
  function test_with_printer_options (line 97) | fn test_with_printer_options<'i, 'o>(source: &'i str, expected: &'i str,...
  function minify_test (line 113) | fn minify_test(source: &str, expected: &str) {
  function minify_test_with_options (line 118) | fn minify_test_with_options<'i, 'o>(source: &'i str, expected: &'i str, ...
  function minify_error_test_with_options (line 137) | fn minify_error_test_with_options<'i, 'o>(
  function prefix_test (line 156) | fn prefix_test(source: &str, expected: &str, targets: Browsers) {
  function attr_test (line 178) | fn attr_test(source: &str, expected: &str, minify: bool, targets: Option...
  function nesting_test (line 199) | fn nesting_test(source: &str, expected: &str) {
  function nesting_test_with_targets (line 212) | fn nesting_test_with_targets(source: &str, expected: &str, targets: Targ...
  function nesting_test_no_targets (line 234) | fn nesting_test_no_targets(source: &str, expected: &str) {
  function css_modules_test (line 250) | fn css_modules_test<'i>(
  function custom_media_test (line 291) | fn custom_media_test(source: &str, expected: &str) {
  function error_test (line 319) | fn error_test(source: &str, error: ParserError) {
  function error_recovery_test (line 327) | fn error_recovery_test(source: &str) -> Vec<Error<ParserError<'_>>> {
  function css_modules_error_test (line 353) | fn css_modules_error_test(source: &str, error: ParserError) {
  function test_border_spacing (line 419) | pub fn test_border_spacing() {
  function test_math_fn (line 486) | pub fn test_math_fn() {
  function test_border (line 602) | pub fn test_border() {
  function test_border_image (line 2158) | pub fn test_border_image() {
  function test_border_radius (line 2634) | pub fn test_border_radius() {
  function test_outline (line 3124) | pub fn test_outline() {
  function test_margin (line 3235) | pub fn test_margin() {
  function test_length (line 3521) | fn test_length() {
  function test_padding (line 3638) | pub fn test_padding() {
  function test_scroll_padding (line 3906) | fn test_scroll_padding() {
  function test_size (line 3927) | fn test_size() {
  function test_background (line 4258) | pub fn test_background() {
  function test_flex (line 4929) | pub fn test_flex() {
  function test_font (line 6190) | fn test_font() {
  function test_vertical_align (line 6652) | fn test_vertical_align() {
  function test_selectors (line 6658) | fn test_selectors() {
  function test_keyframes (line 7508) | fn test_keyframes() {
  function test_important (line 7926) | fn test_important() {
  function test_calc (line 7968) | fn test_calc() {
  function test_trig (line 8334) | fn test_trig() {
  function test_exp (line 8397) | fn test_exp() {
  function test_sign (line 8419) | fn test_sign() {
  function test_box_shadow (line 8432) | fn test_box_shadow() {
  function test_media (line 8666) | fn test_media() {
  function test_merge_layers (line 9468) | fn test_merge_layers() {
  function test_merge_rules (line 9692) | fn test_merge_rules() {
  function test_merge_media_rules (line 11051) | fn test_merge_media_rules() {
  function test_merge_supports (line 11121) | fn test_merge_supports() {
  function test_opacity (line 11191) | fn test_opacity() {
  function test_transitions (line 11201) | fn test_transitions() {
  function test_animation (line 11961) | fn test_animation() {
  function test_transform (line 12722) | fn test_transform() {
  function test_gradients (line 13173) | pub fn test_gradients() {
  function test_font_face (line 14368) | fn test_font_face() {
  function test_font_palette_values (line 14534) | fn test_font_palette_values() {
  function test_font_feature_values (line 14624) | fn test_font_feature_values() {
  function test_page_rule (line 14743) | fn test_page_rule() {
  function test_supports_rule (line 14848) | fn test_supports_rule() {
  function test_counter_style (line 15147) | fn test_counter_style() {
  function test_namespace (line 15167) | fn test_namespace() {
  function test_import (line 15284) | fn test_import() {
  function test_prefixes (line 15332) | fn test_prefixes() {
  function test_display (line 15370) | fn test_display() {
  function test_visibility (line 15560) | fn test_visibility() {
  function test_text_transform (line 15568) | fn test_text_transform() {
  function test_whitespace (line 15597) | fn test_whitespace() {
  function test_tab_size (line 15608) | fn test_tab_size() {
  function test_word_break (line 15652) | fn test_word_break() {
  function test_line_break (line 15660) | fn test_line_break() {
  function test_wrap (line 15667) | fn test_wrap() {
  function test_hyphens (line 15677) | fn test_hyphens() {
  function test_text_align (line 15748) | fn test_text_align() {
  function test_text_align_last (line 15884) | fn test_text_align_last() {
  function test_text_justify (line 15920) | fn test_text_justify() {
  function test_word_spacing (line 15926) | fn test_word_spacing() {
  function test_letter_spacing (line 15932) | fn test_letter_spacing() {
  function test_text_indent (line 15938) | fn test_text_indent() {
  function test_text_size_adjust (line 15962) | fn test_text_size_adjust() {
  function test_text_decoration (line 16009) | fn test_text_decoration() {
  function test_text_emphasis (line 16558) | fn test_text_emphasis() {
  function test_text_shadow (line 16843) | fn test_text_shadow() {
  function test_break (line 16951) | fn test_break() {
  function test_position (line 16989) | fn test_position() {
  function test_overflow (line 17300) | fn test_overflow() {
  function test_ui (line 17437) | fn test_ui() {
  function test_list (line 17682) | fn test_list() {
  function test_image_set (line 17868) | fn test_image_set() {
  function test_color (line 18050) | fn test_color() {
  function test_relative_color (line 19000) | fn test_relative_color() {
  function test_color_mix (line 20832) | fn test_color_mix() {
  function test_grid (line 22310) | fn test_grid() {
  function test_moz_document (line 23299) | fn test_moz_document() {
  function test_custom_properties (line 23331) | fn test_custom_properties() {
  function test_charset (line 24159) | fn test_charset() {
  function test_style_attr (line 24187) | fn test_style_attr() {
  function test_nesting (line 24229) | fn test_nesting() {
  function test_nesting_error_recovery (line 25664) | fn test_nesting_error_recovery() {
  function test_css_variable_error_recovery (line 25680) | fn test_css_variable_error_recovery() {
  function test_css_modules (line 25699) | fn test_css_modules() {
  function test_pseudo_replacement (line 26840) | fn test_pseudo_replacement() {
  function test_unused_symbols (line 26917) | fn test_unused_symbols() {
  function test_svg (line 27119) | fn test_svg() {
  function test_filter (line 27968) | fn test_filter() {
  function test_mix_blend_mode (line 28137) | fn test_mix_blend_mode() {
  function test_viewport (line 28213) | fn test_viewport() {
  function test_at_scope (line 28231) | fn test_at_scope() {
  function test_custom_media (line 28345) | fn test_custom_media() {
  function test_dependencies (line 28952) | fn test_dependencies() {
  function test_api (line 29078) | fn test_api() {
  function test_substitute_vars (line 29193) | fn test_substitute_vars() {
  function test_layer (line 29252) | fn test_layer() {
  function test_property (line 29365) | fn test_property() {
  function test_quoting_unquoting_urls (line 29701) | fn test_quoting_unquoting_urls() {
  function test_zindex (line 29742) | fn test_zindex() {
  function test_input_source_map (line 29752) | fn test_input_source_map() {
  function test_source_maps_with_license_comments (line 29787) | fn test_source_maps_with_license_comments() {
  function test_error_recovery (line 29832) | fn test_error_recovery() {
  function test_invalid (line 29948) | fn test_invalid() {
  function test_container_queries (line 29960) | fn test_container_queries() {
  function test_css_modules_value_rule (line 30423) | fn test_css_modules_value_rule() {
  function test_unknown_at_rules (line 30431) | fn test_unknown_at_rules() {
  function test_resolution (line 30481) | fn test_resolution() {
  function test_environment (line 30526) | fn test_environment() {
  function test_license_comments (line 30658) | fn test_license_comments() {
  function test_starting_style (line 30688) | fn test_starting_style() {
  function test_color_scheme (line 30725) | fn test_color_scheme() {
  function test_print_color_adjust (line 30973) | fn test_print_color_adjust() {
  function test_all (line 31002) | fn test_all() {
  function test_view_transition (line 31038) | fn test_view_transition() {
  function test_skip_generating_unnecessary_fallbacks (line 31058) | fn test_skip_generating_unnecessary_fallbacks() {

FILE: src/logical.rs
  type PropertyCategory (line 2) | pub enum PropertyCategory {
  method default (line 8) | fn default() -> PropertyCategory {
  type LogicalGroup (line 14) | pub enum LogicalGroup {

FILE: src/main.rs
  type CliArgs (line 22) | struct CliArgs {
  type SourceMapJson (line 66) | struct SourceMapJson<'a> {
  function main (line 74) | pub fn main() -> Result<(), std::io::Error> {
  function infer_css_modules_filename (line 287) | fn infer_css_modules_filename(path: &Path) -> Result<String, std::io::Er...

FILE: src/media_query.rs
  type MediaList (line 41) | pub struct MediaList<'i> {
  function new (line 49) | pub fn new() -> Self {
  function parse (line 54) | pub fn parse<'t>(
  function transform_custom_media (line 84) | pub(crate) fn transform_custom_media(
  function transform_resolution (line 95) | pub(crate) fn transform_resolution(&mut self, targets: Targets) {
  function always_matches (line 118) | pub fn always_matches(&self) -> bool {
  function never_matches (line 124) | pub fn never_matches(&self) -> bool {
  function and (line 132) | pub fn and(&mut self, b: &MediaList<'i>) -> Result<(), ()> {
  function or (line 153) | pub fn or(&mut self, b: &MediaList<'i>) {
  method to_css (line 163) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type MediaType (line 203) | pub enum MediaType<'i> {
  function from (line 217) | fn from(name: CowArcStr<'i>) -> Self {
  function into (line 228) | fn into(self) -> CowArcStr<'i> {
  function parse (line 239) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  function is_referenceable (line 248) | fn is_referenceable() -> bool {
  function json_schema (line 252) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  function schema_name (line 256) | fn schema_name() -> String {
  type MediaQuery (line 268) | pub struct MediaQuery<'i> {
  function parse_with_options (line 280) | fn parse_with_options<'t>(
  function transform_custom_media (line 318) | fn transform_custom_media(
  function get_necessary_prefixes (line 339) | fn get_necessary_prefixes(&self, targets: Targets) -> VendorPrefix {
  function transform_resolution (line 347) | fn transform_resolution(&mut self, prefix: VendorPrefix) {
  function always_matches (line 354) | pub fn always_matches(&self) -> bool {
  function never_matches (line 359) | pub fn never_matches(&self) -> bool {
  function and (line 367) | pub fn and<'a>(&mut self, b: &MediaQuery<'i>) -> Result<(), ()> {
  method to_css (line 421) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type MediaQueryOrRaw (line 466) | enum MediaQueryOrRaw<'i> {
  function deserialize (line 481) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  type MediaCondition (line 525) | pub enum MediaCondition<'i> {
  type QueryCondition (line 547) | pub(crate) trait QueryCondition<'i>: Sized {
    method parse_feature (line 548) | fn parse_feature<'t>(
    method create_negation (line 552) | fn create_negation(condition: Box<Self>) -> Self;
    method create_operation (line 553) | fn create_operation(operator: Operator, conditions: Vec<Self>) -> Self;
    method parse_style_query (line 554) | fn parse_style_query<'t>(
    method parse_scroll_state_query (line 561) | fn parse_scroll_state_query<'t>(
    method needs_parens (line 568) | fn needs_parens(&self, parent_operator: Option<Operator>, targets: &Ta...
  function parse_feature (line 573) | fn parse_feature<'t>(
  function create_negation (line 582) | fn create_negation(condition: Box<MediaCondition<'i>>) -> Self {
  function create_operation (line 587) | fn create_operation(operator: Operator, conditions: Vec<MediaCondition<'...
  function needs_parens (line 591) | fn needs_parens(&self, parent_operator: Option<Operator>, targets: &Targ...
  function parse_with_flags (line 616) | fn parse_with_flags<'t>(
  function get_necessary_prefixes (line 633) | fn get_necessary_prefixes(&self, targets: Targets) -> VendorPrefix {
  function transform_resolution (line 651) | fn transform_resolution(&mut self, prefix: VendorPrefix) {
  function parse_with_options (line 687) | fn parse_with_options<'t>(
  function parse_query_condition (line 696) | pub(crate) fn parse_query_condition<'t, 'i, P: QueryCondition<'i>>(
  function parse_parens_or_function (line 770) | fn parse_parens_or_function<'t, 'i, P: QueryCondition<'i>>(
  function parse_paren_block (line 792) | fn parse_paren_block<'t, 'i, P: QueryCondition<'i>>(
  function to_css_with_parens_if_needed (line 813) | pub(crate) fn to_css_with_parens_if_needed<V: ToCss, W>(
  function operation_to_css (line 831) | pub(crate) fn operation_to_css<'i, V: ToCss + QueryCondition<'i>, W>(
  function negate (line 853) | fn negate(&self) -> Option<MediaCondition<'i>> {
  method to_css (line 863) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type MediaFeatureComparison (line 896) | pub enum MediaFeatureComparison {
    method opposite (line 934) | fn opposite(&self) -> MediaFeatureComparison {
    method negate (line 944) | fn negate(&self) -> MediaFeatureComparison {
  method to_css (line 910) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type QueryFeature (line 971) | pub enum QueryFeature<'i, FeatureId> {
  type MediaFeature (line 1011) | pub type MediaFeature<'i> = QueryFeature<'i, MediaFeatureId>;
  function parse_with_options (line 1017) | fn parse_with_options<'t>(
  function parse_name_first (line 1038) | fn parse_name_first<'t>(
  function parse_value_first (line 1077) | fn parse_value_first<'t>(input: &mut Parser<'i, 't>) -> Result<Self, Par...
  function needs_parens (line 1142) | pub(crate) fn needs_parens(&self, parent_operator: Option<Operator>, tar...
  function negate (line 1158) | fn negate(&self) -> Option<QueryFeature<'i, FeatureId>> {
  method to_css (line 1171) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type MediaFeatureName (line 1229) | pub enum MediaFeatureName<'i, FeatureId> {
  function parse (line 1241) | pub fn parse<'t>(
  type ValueType (line 1287) | pub trait ValueType {
    method value_type (line 1289) | fn value_type(&self) -> MediaFeatureType;
    method value_type (line 1296) | fn value_type(&self) -> MediaFeatureType {
  method to_css (line 1305) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type MediaFeatureType (line 1338) | pub enum MediaFeatureType {
    method allows_ranges (line 1358) | fn allows_ranges(&self) -> bool {
  type FeatureToCss (line 1496) | pub(crate) trait FeatureToCss: ToCss {
    method to_css_with_prefix (line 1318) | fn to_css_with_prefix<W>(&self, prefix: &str, dest: &mut Printer<W>) -...
    method to_css_with_prefix (line 1497) | fn to_css_with_prefix<W>(&self, prefix: &str, dest: &mut Printer<W>) -...
    method to_css_with_prefix (line 1503) | fn to_css_with_prefix<W>(&self, prefix: &str, dest: &mut Printer<W>) -...
  function write_min_max (line 1522) | fn write_min_max<W, FeatureId: FeatureToCss>(
  type MediaFeatureValue (line 1587) | pub enum MediaFeatureValue<'i> {
  function value_type (line 1608) | fn value_type(&self) -> MediaFeatureType {
  function check_type (line 1622) | fn check_type(&self, expected_type: MediaFeatureType) -> bool {
  function parse (line 1633) | pub fn parse<'t>(
  function parse_known (line 1644) | fn parse_known<'t>(
  function parse_unknown (line 1666) | fn parse_unknown<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseEr...
  method to_css (line 1697) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function consume_operation_or_colon (line 1724) | fn consume_operation_or_colon<'i, 't>(
  function process_condition (line 1758) | fn process_condition<'i>(
  function parse (line 1900) | fn parse(s: &str) -> MediaQuery<'_> {
  function and (line 1906) | fn and(a: &str, b: &str) -> String {
  function test_and (line 1914) | fn test_and() {
  function test_negated_interval_parens (line 1947) | fn test_negated_interval_parens() {

FILE: src/parser.rs
  type ParserOptions (line 62) | pub struct ParserOptions<'o, 'i> {
  function warn (line 80) | pub(crate) fn warn(&self, warning: ParseError<'i, ParserError<'i>>) {
  type DefaultAtRuleParser (line 91) | pub struct DefaultAtRuleParser;
    type AtRule (line 93) | type AtRule = DefaultAtRule;
    type Error (line 94) | type Error = ();
    type Prelude (line 95) | type Prelude = ();
  type DefaultAtRule (line 101) | pub struct DefaultAtRule;
    method to_css (line 103) | fn to_css<W: std::fmt::Write>(&self, _: &mut Printer<W>) -> Result<(),...
    type Owned (line 113) | type Owned = Self;
    method into_owned (line 114) | fn into_owned(self) -> Self {
    constant CHILD_TYPES (line 122) | const CHILD_TYPES: VisitTypes = VisitTypes::empty();
    method visit_children (line 123) | fn visit_children(&mut self, _: &mut V) -> Result<(), V::Error> {
  type State (line 129) | enum State {
  type TopLevelRuleParser (line 138) | pub struct TopLevelRuleParser<'a, 'o, 'i, T: crate::traits::AtRuleParser...
  function new (line 146) | pub fn new(
  function nested (line 159) | pub fn nested<'x: 'b>(&'x mut self) -> NestedRuleParser<'x, 'o, 'i, T> {
  type AtRulePrelude (line 175) | pub enum AtRulePrelude<'i, T> {
  function allowed_in_style_rule (line 236) | fn allowed_in_style_rule(&self) -> bool {
  type Prelude (line 267) | type Prelude = AtRulePrelude<'i, T::Prelude>;
  type AtRule (line 268) | type AtRule = ();
  type Error (line 269) | type Error = ParserError<'i>;
  function parse_prelude (line 271) | fn parse_prelude<'t>(
  function parse_block (line 332) | fn parse_block<'t>(
  function rule_without_block (line 343) | fn rule_without_block(
  type Prelude (line 413) | type Prelude = SelectorList<'i>;
  type QualifiedRule (line 414) | type QualifiedRule = ();
  type Error (line 415) | type Error = ParserError<'i>;
  function parse_prelude (line 418) | fn parse_prelude<'t>(
  function parse_block (line 427) | fn parse_block<'t>(
  type NestedRuleParser (line 437) | pub struct NestedRuleParser<'a, 'o, 'i, T: crate::traits::AtRuleParser<'...
  function parse_nested (line 448) | pub fn parse_nested<'t>(
  function parse_style_block (line 507) | fn parse_style_block<'t>(
  function loc (line 532) | fn loc(&self, start: &ParserState) -> Location {
  type Prelude (line 543) | type Prelude = AtRulePrelude<'i, T::Prelude>;
  type AtRule (line 544) | type AtRule = ();
  type Error (line 545) | type Error = ParserError<'i>;
  function parse_prelude (line 547) | fn parse_prelude<'t>(
  function rule_without_block (line 722) | fn rule_without_block(
  function parse_block (line 760) | fn parse_block<'t>(
  type Prelude (line 952) | type Prelude = SelectorList<'i>;
  type QualifiedRule (line 953) | type QualifiedRule = ();
  type Error (line 954) | type Error = ParserError<'i>;
  function parse_prelude (line 956) | fn parse_prelude<'t>(
  function parse_block (line 981) | fn parse_block<'t>(
  type Declaration (line 1004) | type Declaration = ();
  type Error (line 1005) | type Error = ParserError<'i>;
  function parse_value (line 1007) | fn parse_value<'t>(
  function parse_qualified (line 1052) | fn parse_qualified(&self) -> bool {
  function parse_declarations (line 1056) | fn parse_declarations(&self) -> bool {
  function parse_custom_at_rule_prelude (line 1061) | fn parse_custom_at_rule_prelude<'i, 't, T: crate::traits::AtRuleParser<'...
  function parse_custom_at_rule_body (line 1090) | fn parse_custom_at_rule_body<'i, 't, T: crate::traits::AtRuleParser<'i>>(
  function parse_custom_at_rule_without_block (line 1110) | fn parse_custom_at_rule_without_block<'i, 't, T: crate::traits::AtRulePa...
  function parse_rule_list (line 1122) | pub fn parse_rule_list<'a, 'o, 'i, 't, T: crate::traits::AtRuleParser<'i>>(
  function parse_style_block (line 1141) | pub fn parse_style_block<'a, 'o, 'i, 't, T: crate::traits::AtRuleParser<...
  function starts_with_ignore_ascii_case (line 1161) | pub fn starts_with_ignore_ascii_case(string: &str, prefix: &str) -> bool {

FILE: src/prefixes.rs
  type Feature (line 7) | pub enum Feature {
    method prefixes_for (line 195) | pub fn prefixes_for(&self, browsers: Browsers) -> VendorPrefix {
  function is_flex_2009 (line 2244) | pub fn is_flex_2009(browsers: Browsers) -> bool {
  function is_webkit_gradient (line 2268) | pub fn is_webkit_gradient(browsers: Browsers) -> bool {

FILE: src/printer.rs
  type PrinterOptions (line 16) | pub struct PrinterOptions<'a> {
  type PseudoClasses (line 44) | pub struct PseudoClasses<'a> {
  type Printer (line 66) | pub struct Printer<'a, 'b, 'c, W> {
  function new (line 94) | pub fn new(dest: &'a mut W, options: PrinterOptions<'a>) -> Self {
  function filename (line 127) | pub fn filename(&self) -> &'c str {
  function write_str (line 143) | pub fn write_str(&mut self, s: &str) -> Result<(), PrinterError> {
  function write_str_with_newlines (line 150) | pub fn write_str_with_newlines(&mut self, s: &str) -> Result<(), Printer...
  function write_char (line 169) | pub fn write_char(&mut self, c: char) -> Result<(), PrinterError> {
  function whitespace (line 184) | pub fn whitespace(&mut self) -> Result<(), PrinterError> {
  function delim (line 194) | pub fn delim(&mut self, delim: char, ws_before: bool) -> Result<(), Prin...
  function newline (line 204) | pub fn newline(&mut self) -> Result<(), PrinterError> {
  function indent (line 218) | pub fn indent(&mut self) {
  function dedent (line 223) | pub fn dedent(&mut self) {
  function indent_by (line 228) | pub fn indent_by(&mut self, amt: u8) {
  function dedent_by (line 233) | pub fn dedent_by(&mut self, amt: u8) {
  function is_nested (line 238) | pub fn is_nested(&self) -> bool {
  function add_mapping (line 245) | pub fn add_mapping(&mut self, loc: Location) {
  function write_ident (line 290) | pub fn write_ident(&mut self, ident: &str, handle_css_module: bool) -> R...
  function write_dashed_ident (line 324) | pub(crate) fn write_dashed_ident(&mut self, ident: &str, is_declaration:...
  function error (line 358) | pub fn error(&self, kind: PrinterErrorKind, loc: crate::dependencies::Lo...
  function with_context (line 369) | pub(crate) fn with_context<T, U, F: FnOnce(&mut Printer<'a, 'b, 'c, W>) ...
  function with_cleared_context (line 388) | pub(crate) fn with_cleared_context<T, U, F: FnOnce(&mut Printer<'a, 'b, ...
  function with_parent_context (line 398) | pub(crate) fn with_parent_context<T, U, F: FnOnce(&mut Printer<'a, 'b, '...
  function context (line 411) | pub(crate) fn context(&self) -> Option<&'a StyleContext<'a, 'b>> {
  function write_str (line 417) | fn write_str(&mut self, s: &str) -> std::fmt::Result {

FILE: src/properties/align.rs
  type BaselinePosition (line 32) | pub enum BaselinePosition {
    method parse (line 40) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 61) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AlignContent (line 124) | pub enum AlignContent {
  type JustifyContent (line 152) | pub enum JustifyContent {
    method parse (line 178) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 208) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method parse (line 254) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 282) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AlignSelf (line 337) | pub enum AlignSelf {
  type JustifySelf (line 366) | pub enum JustifySelf {
    method parse (line 396) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 431) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method parse (line 479) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 503) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AlignItems (line 540) | pub enum AlignItems {
  type LegacyJustify (line 566) | pub enum LegacyJustify {
    method parse (line 576) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 612) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type JustifyItems (line 635) | pub enum JustifyItems {
    method parse (line 666) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 701) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method parse (line 749) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 772) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type GapValue (line 809) | pub enum GapValue {
  method parse (line 827) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 835) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AlignHandler (line 849) | pub(crate) struct AlignHandler {
    method handle_property (line 868) | fn handle_property(
    method finalize (line 979) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut P...
    method flush (line 985) | fn flush<'i>(&mut self, dest: &mut DeclarationList<'i>, context: &mut ...
  function is_align_property (line 1185) | fn is_align_property(property_id: &PropertyId) -> bool {

FILE: src/properties/animation.rs
  type AnimationName (line 37) | pub enum AnimationName<'i> {
  method to_css (line 49) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AnimationNameList (line 89) | pub type AnimationNameList<'i> = SmallVec<[AnimationName<'i>; 1]>;
  type AnimationIterationCount (line 101) | pub enum AnimationIterationCount {
  method default (line 109) | fn default() -> Self {
  method default (line 129) | fn default() -> Self {
  method default (line 145) | fn default() -> Self {
  method default (line 165) | fn default() -> Self {
  type AnimationTimeline (line 192) | pub enum AnimationTimeline<'i> {
  method default (line 207) | fn default() -> Self {
  type ScrollTimeline (line 218) | pub struct ScrollTimeline {
    method parse (line 226) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 254) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method default (line 290) | fn default() -> Self {
  method default (line 310) | fn default() -> Self {
  type ViewTimeline (line 321) | pub struct ViewTimeline {
    method parse (line 329) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 357) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type TimelineRangeName (line 389) | pub enum TimelineRangeName {
  type AnimationAttachmentRange (line 416) | pub enum AnimationAttachmentRange {
    method parse (line 433) | fn parse<'t>(input: &mut Parser<'i, 't>, default: f32) -> Result<Self,...
    method to_css (line 449) | fn to_css<W>(&self, dest: &mut Printer<W>, default: f32) -> Result<(),...
  method default (line 469) | fn default() -> Self {
  type AnimationRangeStart (line 480) | pub struct AnimationRangeStart(pub AnimationAttachmentRange);
    method parse (line 483) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 490) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AnimationRangeEnd (line 504) | pub struct AnimationRangeEnd(pub AnimationAttachmentRange);
    method parse (line 507) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 514) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AnimationRange (line 528) | pub struct AnimationRange {
    method parse (line 536) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 559) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse (line 610) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 660) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type AnimationList (line 720) | pub type AnimationList<'i> = SmallVec<[Animation<'i>; 1]>;
  type AnimationHandler (line 723) | pub(crate) struct AnimationHandler<'i> {
  function handle_property (line 739) | fn handle_property(
  function finalize (line 881) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function flush (line 887) | fn flush(&mut self, dest: &mut DeclarationList<'i>, context: &mut Proper...
  function is_animation_property (line 1077) | fn is_animation_property(property_id: &PropertyId) -> bool {

FILE: src/properties/background.rs
  type BackgroundSize (line 31) | pub enum BackgroundSize {
    method parse (line 55) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 46) | fn default() -> BackgroundSize {
  method to_css (line 76) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 98) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type BackgroundRepeat (line 132) | pub struct BackgroundRepeat {
    method parse (line 149) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 140) | fn default() -> BackgroundRepeat {
  method to_css (line 169) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 190) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  method default (line 208) | fn default() -> BackgroundAttachment {
  method eq (line 242) | fn eq(&self, other: &BackgroundOrigin) -> bool {
  method into (line 253) | fn into(self) -> BackgroundClip {
  method default (line 263) | fn default() -> BackgroundClip {
  method is_background_box (line 269) | fn is_background_box(&self) -> bool {
  method from (line 288) | fn from(pos: Position) -> Self {
  function into (line 294) | fn into(self) -> Position {
  method default (line 303) | fn default() -> Self {
  method parse (line 309) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 316) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Background (line 331) | pub struct Background<'i> {
  function parse (line 352) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 444) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function get_image (line 532) | fn get_image(&self) -> &Image<'i> {
  function with_image (line 537) | fn with_image(&self, image: Image<'i>) -> Self {
  function get_necessary_fallbacks (line 542) | fn get_necessary_fallbacks(&self, targets: Targets) -> ColorFallbackKind {
  function get_fallback (line 547) | fn get_fallback(&self, kind: ColorFallbackKind) -> Self {
  function from_longhands (line 557) | fn from_longhands(decls: &DeclarationBlock<'i>, vendor_prefix: VendorPre...
  function longhands (line 702) | fn longhands(vendor_prefix: VendorPrefix) -> Vec<PropertyId<'static>> {
  function longhand (line 716) | fn longhand(&self, property_id: &PropertyId) -> Option<Property<'i>> {
  function set_longhand (line 746) | fn set_longhand(&mut self, property: &Property<'i>) -> Result<(), ()> {
  type BackgroundHandler (line 794) | pub(crate) struct BackgroundHandler<'i> {
  function handle_property (line 811) | fn handle_property(
  function finalize (line 914) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function flush (line 928) | fn flush(&mut self, dest: &mut DeclarationList<'i>, context: &mut Proper...
  function reset (line 1116) | fn reset(&mut self) {
  function is_background_property (line 1130) | fn is_background_property(property_id: &PropertyId) -> bool {

FILE: src/properties/border.rs
  type BorderSideWidth (line 35) | pub enum BorderSideWidth {
  method default (line 47) | fn default() -> BorderSideWidth {
  method is_compatible (line 53) | fn is_compatible(&self, browsers: Browsers) -> bool {
  method default (line 88) | fn default() -> LineStyle {
  method is_compatible (line 94) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  type GenericBorder (line 104) | pub struct GenericBorder<S, const P: u8> {
  type Owned (line 118) | type Owned = GenericBorder<S::Owned, P>;
  function into_owned (line 119) | fn into_owned(self) -> Self::Owned {
  method default (line 129) | fn default() -> GenericBorder<S, P> {
  function parse (line 139) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 181) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 213) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  type BorderTop (line 228) | pub type BorderTop = GenericBorder<LineStyle, 0>;
  type BorderRight (line 230) | pub type BorderRight = GenericBorder<LineStyle, 1>;
  type BorderBottom (line 232) | pub type BorderBottom = GenericBorder<LineStyle, 2>;
  type BorderLeft (line 234) | pub type BorderLeft = GenericBorder<LineStyle, 3>;
  type BorderBlockStart (line 236) | pub type BorderBlockStart = GenericBorder<LineStyle, 4>;
  type BorderBlockEnd (line 238) | pub type BorderBlockEnd = GenericBorder<LineStyle, 5>;
  type BorderInlineStart (line 240) | pub type BorderInlineStart = GenericBorder<LineStyle, 6>;
  type BorderInlineEnd (line 242) | pub type BorderInlineEnd = GenericBorder<LineStyle, 7>;
  type BorderBlock (line 244) | pub type BorderBlock = GenericBorder<LineStyle, 8>;
  type BorderInline (line 246) | pub type BorderInline = GenericBorder<LineStyle, 9>;
  type Border (line 248) | pub type Border = GenericBorder<LineStyle, 10>;
  type BorderShorthand (line 471) | struct BorderShorthand {
    method set_border (line 478) | pub fn set_border<const P: u8>(&mut self, border: &GenericBorder<LineS...
    method is_valid (line 484) | pub fn is_valid(&self) -> bool {
    method reset (line 488) | pub fn reset(&mut self) {
    method to_border (line 494) | pub fn to_border<const P: u8>(&self) -> GenericBorder<LineStyle, P> {
  type BorderHandler (line 554) | pub(crate) struct BorderHandler<'i> {
  function handle_property (line 571) | fn handle_property(
  function finalize (line 741) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function flush (line 750) | fn flush(&mut self, dest: &mut DeclarationList, context: &mut PropertyHa...
  function flush_unparsed (line 1296) | fn flush_unparsed(
  function is_border_property (line 1371) | fn is_border_property(property_id: &PropertyId) -> bool {

FILE: src/properties/border_image.rs
  method is_compatible (line 41) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type BorderImageRepeat (line 57) | pub struct BorderImageRepeat {
    method parse (line 74) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 65) | fn default() -> BorderImageRepeat {
  method to_css (line 85) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 99) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type BorderImageSideWidth (line 114) | pub enum BorderImageSideWidth {
  method default (line 124) | fn default() -> BorderImageSideWidth {
  method is_compatible (line 130) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type BorderImageSlice (line 144) | pub struct BorderImageSlice {
    method parse (line 161) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 152) | fn default() -> BorderImageSlice {
  method to_css (line 172) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 185) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  function parse (line 209) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  function parse_with_callback (line 215) | pub(crate) fn parse_with_callback<'t, F>(
  function to_css_internal (line 294) | pub(crate) fn to_css_internal<W>(
  method to_css (line 337) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 346) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  type BorderImageHandler (line 369) | pub(crate) struct BorderImageHandler<'i> {
  method default (line 381) | fn default() -> Self {
  function handle_property (line 396) | fn handle_property(
  function finalize (line 466) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function reset (line 473) | pub fn reset(&mut self) {
  function will_flush (line 481) | pub fn will_flush(&self, property: &Property<'i>) -> bool {
  function flush (line 491) | fn flush(&mut self, dest: &mut DeclarationList<'i>, context: &mut Proper...
  function is_border_image_property (line 579) | fn is_border_image_property(property_id: &PropertyId) -> bool {

FILE: src/properties/border_radius.rs
  method default (line 35) | fn default() -> BorderRadius {
  method parse (line 47) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 65) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type BorderRadiusHandler (line 93) | pub(crate) struct BorderRadiusHandler<'i> {
  function handle_property (line 107) | fn handle_property(
  function finalize (line 209) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function flush (line 215) | fn flush(&mut self, dest: &mut DeclarationList<'i>, context: &mut Proper...
  function is_border_radius_property (line 329) | fn is_border_radius_property(property_id: &PropertyId) -> bool {
  function is_logical_border_radius_property (line 345) | fn is_logical_border_radius_property(property_id: &PropertyId) -> bool {

FILE: src/properties/box_shadow.rs
  type BoxShadow (line 30) | pub struct BoxShadow {
    method parse (line 46) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 97) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 129) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type BoxShadowHandler (line 139) | pub(crate) struct BoxShadowHandler {
    method handle_property (line 145) | fn handle_property(
    method finalize (line 185) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut P...
    method flush (line 192) | fn flush<'i>(&mut self, dest: &mut DeclarationList<'i>, context: &mut ...

FILE: src/properties/contain.rs
  method default (line 39) | fn default() -> Self {
  method is_compatible (line 45) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  type ContainerNameList (line 60) | pub enum ContainerNameList<'i> {
  method default (line 69) | fn default() -> Self {
  function parse (line 75) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 94) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 117) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  function parse (line 134) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 146) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/properties/css_modules.rs
  type Composes (line 20) | pub struct Composes<'i> {
  type Specifier (line 42) | pub enum Specifier<'i> {
  function parse (line 53) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  function parse_one_ident (line 78) | fn parse_one_ident<'i, 't>(
  method to_css (line 90) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse (line 114) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 125) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/properties/custom.rs
  type CustomProperty (line 40) | pub struct CustomProperty<'i> {
  function parse (line 50) | pub fn parse<'t>(
  type CustomPropertyName (line 68) | pub enum CustomPropertyName<'i> {
  function from (line 77) | fn from(name: CowArcStr<'i>) -> Self {
  function from (line 87) | fn from(name: CowRcStr<'i>) -> Self {
  function as_ref (line 94) | fn as_ref(&self) -> &str {
  method to_css (line 103) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function deserialize (line 117) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  type UnparsedProperty (line 140) | pub struct UnparsedProperty<'i> {
  function parse (line 150) | pub fn parse<'t>(
  function get_prefixed (line 161) | pub(crate) fn get_prefixed(&self, targets: Targets, feature: Feature) ->...
  function with_property_id (line 169) | pub fn with_property_id(&self, property_id: PropertyId<'i>) -> UnparsedP...
  function substitute_variables (line 179) | pub fn substitute_variables<'x>(
  type TokenList (line 207) | pub struct TokenList<'i>(#[cfg_attr(feature = "serde", serde(borrow))] p...
  type TokenOrValue (line 219) | pub enum TokenOrValue<'i> {
  function from (line 250) | fn from(token: Token<'i>) -> TokenOrValue<'i> {
  function is_whitespace (line 257) | pub fn is_whitespace(&self) -> bool {
  function hash (line 265) | fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
  function parse_with_options (line 282) | fn parse_with_options<'t>(
  function parse (line 291) | pub(crate) fn parse<'t>(
  function parse_raw (line 315) | pub(crate) fn parse_raw<'t>(
  function parse_into (line 363) | fn parse_into<'t>(
  function try_parse_color_token (line 467) | fn try_parse_color_token<'i, 't>(
  function to_css (line 488) | pub(crate) fn to_css<W>(&self, dest: &mut Printer<W>, is_custom_property...
  function to_css_raw (line 557) | pub(crate) fn to_css_raw<W>(&self, dest: &mut Printer<W>) -> Result<(), ...
  function starts_with_whitespace (line 578) | pub(crate) fn starts_with_whitespace(&self) -> bool {
  type Token (line 594) | pub enum Token<'a> {
  function from (line 778) | fn from(t: &cssparser::Token<'a>) -> Token<'a> {
  method to_css (line 843) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function hash (line 928) | fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
  function integer_decode (line 995) | fn integer_decode(v: f32) -> (u32, i16, i8) {
  function get_necessary_fallbacks (line 1010) | pub(crate) fn get_necessary_fallbacks(&self, targets: Targets) -> ColorF...
  function get_fallback (line 1037) | pub(crate) fn get_fallback(&self, kind: ColorFallbackKind) -> Self {
  function get_fallbacks (line 1052) | pub(crate) fn get_fallbacks(&mut self, targets: Targets) -> Vec<(Support...
  function get_features (line 1091) | pub(crate) fn get_features(&self) -> Features {
  function substitute_variables (line 1132) | pub fn substitute_variables(&mut self, vars: &std::collections::HashMap<...
  type VarInliner (line 1138) | struct VarInliner<'a, 'i> {
  type Error (line 1144) | type Error = std::convert::Infallible;
  function visit_types (line 1146) | fn visit_types(&self) -> crate::visitor::VisitTypes {
  function visit_token_list (line 1150) | fn visit_token_list(&mut self, tokens: &mut TokenList<'i>) -> Result<(),...
  type Variable (line 1186) | pub struct Variable<'i> {
  function parse (line 1195) | fn parse<'t>(
  function to_css (line 1211) | fn to_css<W>(&self, dest: &mut Printer<W>, is_custom_property: bool) -> ...
  function get_fallback (line 1227) | fn get_fallback(&self, kind: ColorFallbackKind) -> Self {
  type EnvironmentVariable (line 1245) | pub struct EnvironmentVariable<'i> {
  type EnvironmentVariableName (line 1266) | pub enum EnvironmentVariableName<'i> {
  function name (line 1309) | pub fn name(&self) -> &str {
  function parse (line 1319) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 1336) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse (line 1349) | pub(crate) fn parse<'t>(
  function parse_nested (line 1358) | pub(crate) fn parse_nested<'t>(
  function to_css (line 1382) | pub(crate) fn to_css<W>(&self, dest: &mut Printer<W>, is_custom_property...
  function get_fallback (line 1404) | fn get_fallback(&self, kind: ColorFallbackKind) -> Self {
  type Function (line 1420) | pub struct Function<'i> {
  function to_css (line 1429) | fn to_css<W>(&self, dest: &mut Printer<W>, is_custom_property: bool) -> ...
  function get_fallback (line 1439) | fn get_fallback(&self, kind: ColorFallbackKind) -> Self {
  type UnresolvedColor (line 1460) | pub enum UnresolvedColor<'i> {
  method light_dark (line 1497) | fn light_dark(light: Self, dark: Self) -> Self {
  function parse (line 1506) | fn parse<'t>(
  function to_css (line 1553) | fn to_css<W>(&self, dest: &mut Printer<W>, is_custom_property: bool) -> ...

FILE: src/properties/display.rs
  type DisplayInside (line 37) | pub enum DisplayInside {
    method parse (line 48) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method is_equivalent (line 97) | fn is_equivalent(&self, other: &DisplayInside) -> bool {
  method to_css (line 70) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type DisplayPair (line 119) | pub struct DisplayPair {
    method parse (line 129) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 229) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Display (line 339) | pub enum Display {
  type DisplayHandler (line 363) | pub(crate) struct DisplayHandler<'i> {
  function handle_property (line 369) | fn handle_property(
  function finalize (line 417) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...

FILE: src/properties/effects.rs
  type Filter (line 25) | pub enum Filter<'i> {
  function parse (line 52) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 119) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function get_fallback (line 205) | fn get_fallback(&self, kind: ColorFallbackKind) -> Self {
  method is_compatible (line 214) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  type DropShadow (line 229) | pub struct DropShadow {
    method parse (line 241) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method get_fallback (line 304) | fn get_fallback(&self, kind: ColorFallbackKind) -> DropShadow {
  method to_css (line 281) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type FilterList (line 323) | pub enum FilterList<'i> {
  function parse (line 332) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 347) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 370) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  method is_compatible (line 410) | fn is_compatible(&self, _browsers: Browsers) -> bool {

FILE: src/properties/flex.rs
  method default (line 39) | fn default() -> FlexDirection {
  method default (line 57) | fn default() -> FlexWrap {
  method from_standard (line 63) | fn from_standard(wrap: &FlexWrap) -> Option<FlexWrap> {
  method parse (line 79) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 106) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method parse (line 140) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 183) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method to_2009 (line 247) | fn to_2009(&self) -> (BoxOrient, BoxDirection) {
  method from_standard (line 286) | fn from_standard(align: &AlignItems) -> Option<BoxAlign> {
  method from_standard (line 316) | fn from_standard(justify: &JustifyContent) -> Option<BoxPack> {
  method from_standard (line 344) | fn from_standard(wrap: &FlexWrap) -> Option<BoxLines> {
  type BoxOrdinalGroup (line 353) | type BoxOrdinalGroup = CSSInteger;
    method from_standard (line 355) | fn from_standard(order: &CSSInteger) -> Option<BoxOrdinalGroup> {
  method from_standard (line 380) | fn from_standard(justify: &JustifyContent) -> Option<FlexPack> {
  type FlexAlign (line 398) | pub type FlexAlign = BoxAlign;
  method from_standard (line 420) | fn from_standard(justify: &AlignSelf) -> Option<FlexItemAlign> {
  method from_standard (line 455) | fn from_standard(justify: &AlignContent) -> Option<FlexLinePack> {
  type FlexHandler (line 474) | pub(crate) struct FlexHandler {
    method handle_property (line 494) | fn handle_property(
    method finalize (line 610) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut P...
    method flush (line 616) | fn flush<'i>(&mut self, dest: &mut DeclarationList<'i>, context: &mut ...
  function is_flex_property (line 789) | fn is_flex_property(property_id: &PropertyId) -> bool {

FILE: src/properties/font.rs
  type FontWeight (line 32) | pub enum FontWeight {
  method default (line 42) | fn default() -> FontWeight {
  method is_compatible (line 48) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  type AbsoluteFontWeight (line 68) | pub enum AbsoluteFontWeight {
  method default (line 78) | fn default() -> AbsoluteFontWeight {
  method to_css (line 84) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 98) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  method is_compatible (line 128) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  type FontSize (line 159) | pub enum FontSize {
  method is_compatible (line 169) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  method default (line 209) | fn default() -> FontStretchKeyword {
  function into (line 215) | fn into(self) -> Percentage {
  type FontStretch (line 242) | pub enum FontStretch {
  method default (line 250) | fn default() -> FontStretch {
  function into (line 256) | fn into(self) -> Percentage {
  method to_css (line 265) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 282) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  method is_compatible (line 330) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  type FontFamily (line 346) | pub enum FontFamily<'i> {
  function parse (line 355) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 366) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type FamilyName (line 383) | pub struct FamilyName<'i>(#[cfg_attr(feature = "serde", serde(borrow))] ...
  function parse (line 386) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 415) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 451) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  type FontStyle (line 469) | pub enum FontStyle {
    method default_oblique_angle (line 486) | pub(crate) fn default_oblique_angle() -> Angle {
    method parse (line 492) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 479) | fn default() -> FontStyle {
  method to_css (line 510) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 530) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  method default (line 561) | fn default() -> FontVariantCaps {
  method is_css2 (line 567) | fn is_css2(&self) -> bool {
  method parse_css2 (line 571) | fn parse_css2<'i, 't>(input: &mut Parser<'i, 't>) -> Result<Self, ParseE...
  method is_compatible (line 581) | fn is_compatible(&self, _browsers: crate::targets::Browsers) -> bool {
  type LineHeight (line 596) | pub enum LineHeight {
  method default (line 606) | fn default() -> LineHeight {
  method is_compatible (line 612) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  type VerticalAlign (line 653) | pub enum VerticalAlign {
  function parse (line 682) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 758) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type FontHandler (line 818) | pub(crate) struct FontHandler<'i> {
  function handle_property (line 831) | fn handle_property(
  function finalize (line 894) | fn finalize(&mut self, decls: &mut DeclarationList<'i>, context: &mut Pr...
  function flush (line 901) | fn flush(&mut self, decls: &mut DeclarationList<'i>, context: &mut Prope...
  constant SYSTEM_UI (line 997) | const SYSTEM_UI: FontFamily = FontFamily::Generic(GenericFontFamily::Sys...
  constant DEFAULT_SYSTEM_FONTS (line 999) | const DEFAULT_SYSTEM_FONTS: &[&str] = &[
  function compatible_font_family (line 1016) | fn compatible_font_family(mut family: Option<Vec<FontFamily>>, is_suppor...
  function is_font_property (line 1036) | fn is_font_property(property_id: &PropertyId) -> bool {

FILE: src/properties/grid.rs
  type TrackSizing (line 36) | pub enum TrackSizing<'i> {
  type TrackList (line 57) | pub struct TrackList<'i> {
  type TrackListItem (line 77) | pub enum TrackListItem<'i> {
  type TrackSize (line 98) | pub enum TrackSize {
    method parse (line 200) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 115) | fn default() -> TrackSize {
  type TrackSizeList (line 127) | pub struct TrackSizeList(pub SmallVec<[TrackSize; 1]>);
    method parse (line 501) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  type TrackBreadth (line 141) | pub enum TrackBreadth {
    method parse (line 246) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method parse_internal (line 252) | fn parse_internal<'i, 't>(
    method parse_flex (line 278) | fn parse_flex<'i, 't>(input: &mut Parser<'i, 't>) -> Result<CSSNumber,...
  type TrackRepeat (line 167) | pub struct TrackRepeat<'i> {
  type RepeatCount (line 190) | pub enum RepeatCount {
  method to_css (line 223) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method to_css (line 290) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse (line 305) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 336) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse_line_names (line 368) | fn parse_line_names<'i, 't>(
  function serialize_line_names (line 381) | fn serialize_line_names<W>(names: &[CustomIdent], dest: &mut Printer<W>)...
  function write_ident (line 398) | fn write_ident<W>(name: &str, dest: &mut Printer<W>) -> Result<(), Print...
  function parse (line 424) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 452) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function is_explicit (line 486) | fn is_explicit(&self) -> bool {
  function is_explicit (line 492) | fn is_explicit(&self) -> bool {
  method to_css (line 514) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type GridTemplateAreas (line 546) | pub enum GridTemplateAreas {
    method parse (line 560) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method parse_string (line 586) | fn parse_string(string: &str, tokens: &mut Vec<Option<String>>) -> Res...
    method write_string (line 665) | fn write_string<'a, W>(
  function is_name_code_point (line 623) | fn is_name_code_point(c: char) -> bool {
  method to_css (line 628) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type GridTemplate (line 716) | pub struct GridTemplate<'i> {
  function parse (line 727) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 807) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function to_css_with_indent (line 816) | fn to_css_with_indent<W>(&self, dest: &mut Printer<W>, indent: u8) -> Re...
  function is_valid (line 918) | fn is_valid(rows: &TrackSizing, columns: &TrackSizing, areas: &GridTempl...
  type SerializedGridAutoFlow (line 961) | struct SerializedGridAutoFlow {
    method from (line 969) | fn from(flow: GridAutoFlow) -> Self {
  method from (line 982) | fn from(s: SerializedGridAutoFlow) -> GridAutoFlow {
  type AutoFlowDirection (line 1001) | enum AutoFlowDirection {
  method is_referenceable (line 1009) | fn is_referenceable() -> bool {
  method json_schema (line 1013) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  method schema_name (line 1017) | fn schema_name() -> String {
  method default (line 1023) | fn default() -> GridAutoFlow {
  method direction (line 1029) | fn direction(self) -> GridAutoFlow {
  method parse (line 1035) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 1083) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Grid (line 1121) | pub struct Grid<'i> {
  function parse (line 1138) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  function parse_grid_auto_flow (line 1182) | fn parse_grid_auto_flow<'i, 't>(
  method to_css (line 1201) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function is_valid (line 1293) | fn is_valid(
  type GridLine (line 1358) | pub enum GridLine<'i> {
  function parse (line 1384) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 1432) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function default_end_value (line 1466) | fn default_end_value(&self) -> GridLine<'i> {
  function can_omit_end (line 1474) | fn can_omit_end(&self, end: &GridLine) -> bool {
  function parse (line 1561) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 1610) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type GridHandler (line 1640) | pub(crate) struct GridHandler<'i> {
  function handle_property (line 1655) | fn handle_property(
  function finalize (line 1712) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, _: &mut PropertyH...
  function pad_grid_template_areas (line 1854) | fn pad_grid_template_areas(rows: &TrackSizing, areas: GridTemplateAreas)...
  function is_grid_property (line 1881) | fn is_grid_property(property_id: &PropertyId) -> bool {

FILE: src/properties/list.rs
  type ListStyleType (line 27) | pub enum ListStyleType<'i> {
  method default (line 38) | fn default() -> Self {
  method is_compatible (line 44) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type CounterStyle (line 63) | pub enum CounterStyle<'i> {
  function parse (line 192) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 216) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 250) | fn is_compatible(&self, browsers: Browsers) -> bool {
  method default (line 275) | fn default() -> Self {
  type Symbol (line 293) | pub enum Symbol<'i> {
  method default (line 312) | fn default() -> ListStylePosition {
  method is_compatible (line 318) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  function parse (line 346) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 415) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 450) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {

FILE: src/properties/masking.rs
  method default (line 49) | fn default() -> MaskMode {
  method from (line 70) | fn from(mode: MaskMode) -> WebKitMaskSourceType {
  method default (line 101) | fn default() -> GeometryBox {
  type MaskClip (line 116) | pub enum MaskClip {
  method is_compatible (line 124) | fn is_compatible(&self, browsers: Browsers) -> bool {
  method into (line 133) | fn into(self) -> MaskClip {
  method is_compatible (line 139) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  method default (line 159) | fn default() -> MaskComposite {
  method from (line 190) | fn from(composite: MaskComposite) -> WebKitMaskComposite {
  function parse (line 224) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 313) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function get_image (line 361) | fn get_image(&self) -> &Image<'i> {
  function with_image (line 366) | fn with_image(&self, image: Image<'i>) -> Self {
  type ClipPath (line 381) | pub enum ClipPath<'i> {
  function parse (line 401) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 430) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method default (line 464) | fn default() -> MaskBorderMode {
  function parse (line 490) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 519) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 533) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  function into (line 544) | fn into(self) -> BorderImage<'i> {
  type MaskHandler (line 579) | pub(crate) struct MaskHandler<'i> {
  function handle_property (line 599) | fn handle_property(
  function finalize (line 755) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function flush (line 762) | fn flush(&mut self, dest: &mut DeclarationList<'i>, context: &mut Proper...
  function flush_mask (line 773) | fn flush_mask(&mut self, dest: &mut DeclarationList<'i>, context: &mut P...
  function flush_mask_shorthand (line 956) | fn flush_mask_shorthand(
  function flush_mask_border (line 1006) | fn flush_mask_border(&mut self, dest: &mut DeclarationList<'i>, context:...
  function is_mask_property (line 1141) | fn is_mask_property(property_id: &PropertyId) -> bool {
  function is_mask_border_property (line 1157) | fn is_mask_border_property(property_id: &PropertyId) -> bool {
  function get_webkit_mask_property (line 1171) | pub(crate) fn get_webkit_mask_property(property_id: &PropertyId) -> Opti...

FILE: src/properties/mod.rs
  function parse (line 1626) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 1645) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse (line 1661) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 1667) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/properties/outline.rs
  type OutlineStyle (line 27) | pub enum OutlineStyle {
  method default (line 35) | fn default() -> OutlineStyle {
  method is_compatible (line 41) | fn is_compatible(&self, _browsers: Browsers) -> bool {
  type Outline (line 47) | pub type Outline = GenericBorder<OutlineStyle, 11>;

FILE: src/properties/overflow.rs
  method parse (line 43) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 51) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type OverflowHandler (line 75) | pub(crate) struct OverflowHandler {
    method handle_property (line 81) | fn handle_property(
    method finalize (line 111) | fn finalize(&mut self, dest: &mut DeclarationList, context: &mut Prope...

FILE: src/properties/position.rs
  type Position (line 26) | pub enum Position {
    method parse (line 40) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 58) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type ZIndex (line 85) | pub enum ZIndex {
  type PositionHandler (line 93) | pub(crate) struct PositionHandler {
    method handle_property (line 98) | fn handle_property(
    method finalize (line 117) | fn finalize(&mut self, dest: &mut DeclarationList, context: &mut Prope...

FILE: src/properties/size.rs
  type Size (line 36) | pub enum Size {
    method parse (line 62) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 98) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 135) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  type MaxSize (line 169) | pub enum MaxSize {
    method parse (line 195) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 231) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 268) | fn is_compatible(&self, browsers: crate::targets::Browsers) -> bool {
  function parse_fit_content (line 290) | fn parse_fit_content<'i, 't>(
  type AspectRatio (line 313) | pub struct AspectRatio {
    method parse (line 321) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 340) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type SizeHandler (line 378) | pub(crate) struct SizeHandler {
    method handle_property (line 397) | fn handle_property(
    method finalize (line 478) | fn finalize(&mut self, dest: &mut DeclarationList, context: &mut Prope...
    method flush (line 485) | fn flush<'i>(&mut self, dest: &mut DeclarationList, context: &mut Prop...

FILE: src/properties/svg.rs
  type SVGPaint (line 25) | pub enum SVGPaint<'i> {
  type SVGPaintFallback (line 57) | pub enum SVGPaintFallback {
  method get_fallbacks (line 65) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  method is_compatible (line 89) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type StrokeDasharray (line 139) | pub enum StrokeDasharray {
    method parse (line 147) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 172) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Marker (line 204) | pub enum Marker<'i> {
  type ColorInterpolation (line 223) | pub enum ColorInterpolation {
  type ColorRendering (line 242) | pub enum ColorRendering {
  type ShapeRendering (line 262) | pub enum ShapeRendering {
  type TextRendering (line 284) | pub enum TextRendering {
  type ImageRendering (line 305) | pub enum ImageRendering {

FILE: src/properties/text.rs
  method default (line 43) | fn default() -> TextTransformCase {
  method parse (line 65) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 79) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type SerializedTextTransformOther (line 107) | struct SerializedTextTransformOther {
    method from (line 115) | fn from(t: TextTransformOther) -> Self {
  method from (line 124) | fn from(t: SerializedTextTransformOther) -> Self {
  method is_referenceable (line 139) | fn is_referenceable() -> bool {
  method json_schema (line 143) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  method schema_name (line 147) | fn schema_name() -> String {
  type TextTransform (line 158) | pub struct TextTransform {
    method parse (line 167) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 199) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Spacing (line 360) | pub enum Spacing {
  type TextIndent (line 377) | pub struct TextIndent {
    method parse (line 387) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 430) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type TextSizeAdjust (line 455) | pub enum TextSizeAdjust {
  method default (line 489) | fn default() -> TextDecorationLine {
  method parse (line 495) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 534) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type SerializedTextDecorationLine (line 574) | enum SerializedTextDecorationLine {
    method from (line 605) | fn from(l: TextDecorationLine) -> Self {
  type ExclusiveTextDecorationLine (line 585) | enum ExclusiveTextDecorationLine {
  type OtherTextDecorationLine (line 597) | enum OtherTextDecorationLine {
  method from (line 639) | fn from(l: SerializedTextDecorationLine) -> Self {
  method is_referenceable (line 665) | fn is_referenceable() -> bool {
  method json_schema (line 669) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  method schema_name (line 673) | fn schema_name() -> String {
  method default (line 695) | fn default() -> TextDecorationStyle {
  type TextDecorationThickness (line 710) | pub enum TextDecorationThickness {
  method default (line 720) | fn default() -> TextDecorationThickness {
  method parse (line 740) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 775) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 811) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  type TextEmphasisStyle (line 873) | pub enum TextEmphasisStyle<'i> {
  method default (line 892) | fn default() -> TextEmphasisStyle<'i> {
  function parse (line 898) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 923) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function parse (line 961) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 991) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method get_fallbacks (line 1007) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  type TextEmphasisPosition (line 1047) | pub struct TextEmphasisPosition {
    method parse (line 1055) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 1080) | fn default() -> Self {
  method to_css (line 1086) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type TextDecorationHandler (line 1100) | pub(crate) struct TextDecorationHandler<'i> {
  function handle_property (line 1112) | fn handle_property(
  function finalize (line 1213) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  type TextShadow (line 1368) | pub struct TextShadow {
    method parse (line 1382) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 1424) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method is_compatible (line 1452) | fn is_compatible(&self, browsers: Browsers) -> bool {
  function is_text_decoration_property (line 1462) | fn is_text_decoration_property(property_id: &PropertyId) -> bool {
  function is_text_emphasis_property (line 1474) | fn is_text_emphasis_property(property_id: &PropertyId) -> bool {
  method get_fallbacks (line 1485) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {

FILE: src/properties/transform.rs
  type TransformList (line 28) | pub struct TransformList(pub Vec<Transform>);
    method parse (line 31) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method to_css_base (line 125) | fn to_css_base<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterE...
    method to_matrix (line 142) | pub fn to_matrix(&self) -> Option<Matrix3d<f32>> {
  method to_css (line 50) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Transform (line 165) | pub enum Transform {
    method parse (line 853) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method to_matrix (line 1305) | pub fn to_matrix(&self) -> Option<Matrix3d<f32>> {
  type Matrix (line 217) | pub struct Matrix<T> {
  function to_matrix3d (line 228) | pub fn to_matrix3d(&self) -> Matrix3d<f32> {
  type Matrix3d (line 256) | pub struct Matrix3d<T> {
  function identity (line 278) | pub fn identity() -> Matrix3d<f32> {
  function translate (line 300) | pub fn translate(x: f32, y: f32, z: f32) -> Matrix3d<f32> {
  function scale (line 322) | pub fn scale(x: f32, y: f32, z: f32) -> Matrix3d<f32> {
  function rotate (line 344) | pub fn rotate(x: f32, y: f32, z: f32, angle: f32) -> Matrix3d<f32> {
  function skew (line 390) | pub fn skew(a: f32, b: f32) -> Matrix3d<f32> {
  function perspective (line 412) | pub fn perspective(d: f32) -> Matrix3d<f32> {
  function multiply (line 434) | pub fn multiply(&self, other: &Self) -> Self {
  function is_2d (line 456) | pub fn is_2d(&self) -> bool {
  function to_matrix2d (line 471) | pub fn to_matrix2d(&self) -> Option<Matrix<f32>> {
  function scale_by_factor (line 486) | pub fn scale_by_factor(&mut self, scaling_factor: f32) {
  function determinant (line 506) | pub fn determinant(&self) -> f32 {
  function inverse (line 534) | pub fn inverse(&self) -> Option<Matrix3d<f32>> {
  function transpose (line 626) | pub fn transpose(&self) -> Self {
  function multiply_vector (line 648) | pub fn multiply_vector(&self, pin: &[f32; 4]) -> [f32; 4] {
  function decompose (line 658) | pub fn decompose(&self) -> Option<TransformList> {
  method to_css (line 1025) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Perspective (line 1419) | pub enum Perspective {
  type Translate (line 1436) | pub enum Translate {
    method parse (line 1453) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method to_transform (line 1502) | pub fn to_transform(&self) -> Transform {
  method to_css (line 1475) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Rotate (line 1522) | pub enum Rotate {
    method parse (line 1541) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method to_transform (line 1615) | pub fn to_transform(&self) -> Transform {
  method to_css (line 1576) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Scale (line 1633) | pub enum Scale {
    method parse (line 1659) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
    method to_transform (line 1711) | pub fn to_transform(&self) -> Transform {
  function convert_percentage_to_number (line 1649) | fn convert_percentage_to_number<'i, 't>(
  method to_css (line 1681) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type TransformHandler (line 1724) | pub(crate) struct TransformHandler {
    method handle_property (line 1733) | fn handle_property(
    method finalize (line 1798) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut P...
    method flush (line 1804) | fn flush<'i>(&mut self, dest: &mut DeclarationList<'i>, context: &mut ...

FILE: src/properties/transition.rs
  function parse (line 38) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 86) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type ViewTransitionName (line 120) | pub enum ViewTransitionName<'i> {
  type ViewTransitionGroup (line 141) | pub enum ViewTransitionGroup<'i> {
  type TransitionHandler (line 155) | pub(crate) struct TransitionHandler<'i> {
  function handle_property (line 164) | fn handle_property(
  function finalize (line 240) | fn finalize(&mut self, dest: &mut DeclarationList<'i>, context: &mut Pro...
  function flush (line 246) | fn flush(&mut self, dest: &mut DeclarationList<'i>, context: &mut Proper...
  function reset (line 359) | fn reset(&mut self) {
  function is_transition_property (line 368) | fn is_transition_property(property_id: &PropertyId) -> bool {
  function merge_properties (line 379) | fn merge_properties<'i: 'a, 'a>(val: impl Iterator<Item = &'a PropertyId...
  function expand_properties (line 396) | fn expand_properties<'i>(
  type LogicalPropertyId (line 472) | enum LogicalPropertyId {
  function get_logical_properties (line 483) | fn get_logical_properties(property_id: &PropertyId) -> LogicalPropertyId {

FILE: src/properties/ui.rs
  type CursorImage (line 50) | pub struct CursorImage<'i> {
  function parse (line 59) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 73) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type Cursor (line 141) | pub struct Cursor<'i> {
  function parse (line 150) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 168) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type ColorOrAuto (line 190) | pub enum ColorOrAuto {
  method default (line 198) | fn default() -> ColorOrAuto {
  method get_fallbacks (line 204) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  method is_compatible (line 217) | fn is_compatible(&self, browsers: Browsers) -> bool {
  method default (line 240) | fn default() -> CaretShape {
  method get_fallbacks (line 256) | fn get_fallbacks(&mut self, targets: Targets) -> Vec<Self> {
  method is_compatible (line 270) | fn is_compatible(&self, browsers: Browsers) -> bool {
  type Appearance (line 296) | pub enum Appearance<'i> {
  function from_str (line 317) | fn from_str(name: &str) -> Option<Self> {
  function to_str (line 339) | fn to_str(&self) -> &str {
  function parse (line 363) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 370) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function serialize (line 381) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
  function deserialize (line 392) | fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
  function is_referenceable (line 404) | fn is_referenceable() -> bool {
  function json_schema (line 408) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  function schema_name (line 412) | fn schema_name() -> String {
  method parse (line 434) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 478) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type SerializedColorScheme (line 511) | struct SerializedColorScheme {
    method from (line 518) | fn from(color_scheme: ColorScheme) -> Self {
  method from (line 528) | fn from(s: SerializedColorScheme) -> ColorScheme {
  method is_referenceable (line 540) | fn is_referenceable() -> bool {
  method json_schema (line 544) | fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::sc...
  method schema_name (line 548) | fn schema_name() -> String {
  type ColorSchemeHandler (line 554) | pub(crate) struct ColorSchemeHandler;
    method handle_property (line 557) | fn handle_property(
    method finalize (line 586) | fn finalize(&mut self, _: &mut DeclarationList<'i>, _: &mut PropertyHa...
  function define_var (line 600) | fn define_var<'i>(name: &'static str, value: Token<'static>) -> Property...

FILE: src/rules/container.rs
  type ContainerRule (line 30) | pub struct ContainerRule<'i, R = DefaultAtRule> {
  type ContainerCondition (line 53) | pub enum ContainerCondition<'i> {
  type ContainerSizeFeature (line 81) | pub type ContainerSizeFeature<'i> = QueryFeature<'i, ContainerSizeFeatur...
  method to_css_with_prefix (line 102) | fn to_css_with_prefix<W>(&self, prefix: &str, dest: &mut Printer<W>) -> ...
  type StyleQuery (line 121) | pub enum StyleQuery<'i> {
  type ScrollStateQuery (line 153) | pub enum ScrollStateQuery<'i> {
  type ScrollStateFeature (line 172) | pub type ScrollStateFeature<'i> = QueryFeature<'i, ScrollStateFeatureId>;
  method to_css_with_prefix (line 189) | fn to_css_with_prefix<W>(&self, prefix: &str, dest: &mut Printer<W>) -> ...
  function parse_feature (line 200) | fn parse_feature<'t>(
  function create_negation (line 209) | fn create_negation(condition: Box<ContainerCondition<'i>>) -> Self {
  function create_operation (line 214) | fn create_operation(operator: Operator, conditions: Vec<Self>) -> Self {
  function parse_style_query (line 218) | fn parse_style_query<'t>(
  function parse_scroll_state_query (line 233) | fn parse_scroll_state_query<'t>(
  function needs_parens (line 248) | fn needs_parens(&self, parent_operator: Option<Operator>, targets: &Targ...
  function parse_feature (line 262) | fn parse_feature<'t>(
  function create_negation (line 271) | fn create_negation(condition: Box<Self>) -> Self {
  function create_operation (line 276) | fn create_operation(operator: Operator, conditions: Vec<Self>) -> Self {
  function needs_parens (line 280) | fn needs_parens(&self, parent_operator: Option<Operator>, targets: &Targ...
  function parse_feature (line 291) | fn parse_feature<'t>(
  function create_negation (line 307) | fn create_negation(condition: Box<Self>) -> Self {
  function create_operation (line 312) | fn create_operation(operator: Operator, conditions: Vec<Self>) -> Self {
  function needs_parens (line 316) | fn needs_parens(&self, parent_operator: Option<Operator>, _targets: &Tar...
  function parse_with_options (line 326) | fn parse_with_options<'t>(
  method to_css (line 352) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method to_css (line 389) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  method to_css (line 409) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type ContainerName (line 433) | pub struct ContainerName<'i>(#[cfg_attr(feature = "serde", serde(borrow)...
  function parse (line 436) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 446) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  function minify (line 463) | pub(crate) fn minify(
  method to_css (line 474) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/rules/counter_style.rs
  type CounterStyleRule (line 18) | pub struct CounterStyleRule<'i> {
  method to_css (line 31) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/rules/custom_media.rs
  type CustomMediaRule (line 18) | pub struct CustomMediaRule<'i> {
  method to_css (line 30) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/rules/document.rs
  type MozDocumentRule (line 21) | pub struct MozDocumentRule<'i, R = DefaultAtRule> {
  function minify (line 31) | pub(crate) fn minify(&mut self, context: &mut MinifyContext<'_, 'i>) -> ...
  method to_css (line 37) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>

FILE: src/rules/font_face.rs
  type FontFaceRule (line 26) | pub struct FontFaceRule<'i> {
  type FontFaceProperty (line 47) | pub enum FontFaceProperty<'i> {
  type Source (line 76) | pub enum Source<'i> {
  function parse (line 85) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 104) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type UrlSource (line 126) | pub struct UrlSource<'i> {
  function parse (line 137) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 157) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type FontFormat (line 191) | pub enum FontFormat<'i> {
  function parse (line 214) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i, ...
  method to_css (line 230) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type UnicodeRange (line 304) | pub struct UnicodeRange {
    method parse (line 312) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method to_css (line 322) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type FontStyle (line 384) | pub enum FontStyle {
    method default_oblique_angle (line 401) | fn default_oblique_angle() -> Size2D<Angle> {
    method parse (line 410) | fn parse<'t>(input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i...
  method default (line 394) | fn default() -> FontStyle {
  method to_css (line 423) | fn to_css<W>(&self, dest: &mut Printer<W>) -> Result<(), PrinterError>
  type FontFaceDeclarationParser (line 442) | pub(crate) struct FontFaceDeclarationParser;
    type Declaration (line 446) | type Declaration = FontFaceProperty<'i>;
    type Error (line 447) | type Error = ParserError<'i>;
    method parse_value (line 449) | fn parse_value<'t>(
    type Prelude (line 490) | type Prelude = ();
    type AtRule (line 491) | type AtRule = FontFaceProperty<'i>;
    type Error (line 492) | type Error = ParserError<'i>;
    type Prelude (line 496) | type Prelude = ();
    type QualifiedRule (line 497) | type QualifiedRule = FontFac
Condensed preview — 219 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,929K chars).
[
  {
    "path": ".cargo/config.toml",
    "chars": 716,
    "preview": "[target.'cfg(target_env = \"gnu\")']\nrustflags = [\"-C\", \"link-args=-Wl,-z,nodelete\"]\n\n[target.aarch64-unknown-linux-gnu]\nl"
  },
  {
    "path": ".github/workflows/release-crates.yml",
    "chars": 527,
    "preview": "name: release-crates\non:\n  workflow_dispatch:\n\njobs:\n  release-crates:\n    runs-on: ubuntu-latest\n    name: Release Rust"
  },
  {
    "path": ".github/workflows/release.yml",
    "chars": 10206,
    "preview": "name: release\non:\n  workflow_dispatch:\n\njobs:\n  build:\n    strategy:\n      fail-fast: false\n      matrix:\n        includ"
  },
  {
    "path": ".github/workflows/test.yml",
    "chars": 1642,
    "preview": "name: test\n\non:\n  push:\n    branches: [master]\n  pull_request:\n    branches: [master]\n\njobs:\n  test:\n    runs-on: ubuntu"
  },
  {
    "path": ".gitignore",
    "chars": 104,
    "preview": ".DS_Store\n*.node\nnode_modules/\ntarget/\npkg/\ndist/\n.parcel-cache\nnode/*.flow\nartifacts\nnpm\nnode/ast.json\n"
  },
  {
    "path": ".prettierrc",
    "chars": 100,
    "preview": "{\n  \"bracketSpacing\": false,\n  \"endOfLine\": \"lf\",\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 2026,
    "preview": "# Contributing\n\nWelcome, we really appreciate if you're considering to contribute, the joint effort of our contributors "
  },
  {
    "path": "Cargo.toml",
    "chars": 3239,
    "preview": "[workspace]\nmembers = [\n  \"node\",\n  \"napi\",\n  \"selectors\",\n  \"c\",\n  \"derive\",\n  \"static-self\",\n  \"static-self-derive\",\n]"
  },
  {
    "path": "LICENSE",
    "chars": 15648,
    "preview": " Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor"
  },
  {
    "path": "README.md",
    "chars": 6034,
    "preview": "# ⚡️ Lightning CSS\n\nAn extremely fast CSS parser, transformer, and minifier written in Rust. Use it with [Parcel](https:"
  },
  {
    "path": "bench.js",
    "chars": 1050,
    "preview": "const css = require('./');\nconst cssnano = require('cssnano');\nconst postcss = require('postcss');\nconst esbuild = requi"
  },
  {
    "path": "c/Cargo.toml",
    "chars": 398,
    "preview": "[package]\nauthors = [\"Devon Govett <devongovett@gmail.com>\"]\nname = \"lightningcss_c_bindings\"\nversion = \"0.1.0\"\nedition "
  },
  {
    "path": "c/build.rs",
    "chars": 202,
    "preview": "use std::env;\n\nfn main() {\n  let crate_dir = env::var(\"CARGO_MANIFEST_DIR\").unwrap();\n\n  cbindgen::generate(crate_dir)\n "
  },
  {
    "path": "c/cbindgen.toml",
    "chars": 152,
    "preview": "language = \"C\"\n\n[parse]\nparse_deps = false\ninclude = [\"lightningcss\"]\n\n[export.rename]\nStyleSheetWrapper = \"StyleSheet\"\n"
  },
  {
    "path": "c/lightningcss.h",
    "chars": 4274,
    "preview": "#include <stdarg.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n\ntypedef struct CssError CssError;\n\ntyp"
  },
  {
    "path": "c/src/lib.rs",
    "chars": 16287,
    "preview": "#![allow(clippy::not_unsafe_ptr_arg_deref)]\n\nuse std::collections::HashSet;\nuse std::ffi::{CStr, CString};\nuse std::mem:"
  },
  {
    "path": "c/test.c",
    "chars": 3077,
    "preview": "#include <stdio.h>\n#include <string.h>\n#include \"lightningcss.h\"\n\nint print_error(CssError *error);\n\nint main()\n{\n  char"
  },
  {
    "path": "cli/.gitignore",
    "chars": 50,
    "preview": "package.json\nREADME.md\n.DS_Store\nlightningcss.exe\n"
  },
  {
    "path": "cli/lightningcss",
    "chars": 78,
    "preview": "This file is required so that npm creates the lightningcss binary on Windows.\n"
  },
  {
    "path": "cli/postinstall.js",
    "chars": 1259,
    "preview": "let fs = require('fs');\nlet path = require('path');\n\nlet parts = [process.platform, process.arch];\nif (process.platform "
  },
  {
    "path": "derive/Cargo.toml",
    "chars": 416,
    "preview": "[package]\nauthors = [\"Devon Govett <devongovett@gmail.com>\"]\nname = \"lightningcss-derive\"\ndescription = \"Derive macros f"
  },
  {
    "path": "derive/src/lib.rs",
    "chars": 525,
    "preview": "use proc_macro::TokenStream;\n\nmod parse;\nmod to_css;\nmod visit;\n\n#[proc_macro_derive(Visit, attributes(visit, skip_visit"
  },
  {
    "path": "derive/src/parse.rs",
    "chars": 5374,
    "preview": "use convert_case::Casing;\nuse proc_macro::{self, TokenStream};\nuse proc_macro2::{Literal, Span, TokenStream as TokenStre"
  },
  {
    "path": "derive/src/to_css.rs",
    "chars": 4036,
    "preview": "use convert_case::Casing;\nuse proc_macro::{self, TokenStream};\nuse proc_macro2::{Literal, Span, TokenStream as TokenStre"
  },
  {
    "path": "derive/src/visit.rs",
    "chars": 7890,
    "preview": "use std::collections::HashSet;\n\nuse proc_macro::{self, TokenStream};\nuse proc_macro2::{Span, TokenStream as TokenStream2"
  },
  {
    "path": "examples/custom_at_rule.rs",
    "chars": 8470,
    "preview": "use std::{collections::HashMap, convert::Infallible};\n\nuse cssparser::*;\nuse lightningcss::{\n  declaration::DeclarationB"
  },
  {
    "path": "examples/schema.rs",
    "chars": 251,
    "preview": "fn main() {\n  #[cfg(feature = \"jsonschema\")]\n  {\n    let schema = schemars::schema_for!(lightningcss::stylesheet::StyleS"
  },
  {
    "path": "examples/serialize.rs",
    "chars": 589,
    "preview": "fn main() {\n  parse();\n}\n\n#[cfg(feature = \"serde\")]\nfn parse() {\n  use lightningcss::stylesheet::{ParserOptions, StyleSh"
  },
  {
    "path": "napi/Cargo.toml",
    "chars": 991,
    "preview": "[package]\nauthors = [\"Devon Govett <devongovett@gmail.com>\"]\nname = \"lightningcss-napi\"\nversion = \"0.4.8\"\ndescription = "
  },
  {
    "path": "napi/src/at_rule_parser.rs",
    "chars": 5604,
    "preview": "use std::collections::HashMap;\n\nuse cssparser::*;\nuse lightningcss::{\n  declaration::DeclarationBlock,\n  error::ParserEr"
  },
  {
    "path": "napi/src/lib.rs",
    "chars": 38793,
    "preview": "#[cfg(feature = \"bundler\")]\nuse at_rule_parser::AtRule;\nuse at_rule_parser::{CustomAtRuleConfig, CustomAtRuleParser};\nus"
  },
  {
    "path": "napi/src/threadsafe_function.rs",
    "chars": 8948,
    "preview": "// Fork of threadsafe_function from napi-rs that allows calling JS function manually rather than\n// only returning args."
  },
  {
    "path": "napi/src/transformer.rs",
    "chars": 27857,
    "preview": "use std::{\n  marker::PhantomData,\n  ops::{Index, IndexMut},\n};\n\nuse lightningcss::{\n  media_query::MediaFeatureValue,\n  "
  },
  {
    "path": "napi/src/utils.rs",
    "chars": 314,
    "preview": "use napi::{Error, JsObject, JsUnknown, Result};\n\n// Workaround for https://github.com/napi-rs/napi-rs/issues/1641\npub fn"
  },
  {
    "path": "node/Cargo.toml",
    "chars": 604,
    "preview": "[package]\nauthors = [\"Devon Govett <devongovett@gmail.com>\"]\nname = \"lightningcss_node\"\nversion = \"0.1.0\"\nedition = \"202"
  },
  {
    "path": "node/ast.d.ts",
    "chars": 212319,
    "preview": "/* eslint-disable */\n/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY H"
  },
  {
    "path": "node/browserslistToTargets.js",
    "chars": 929,
    "preview": "const BROWSER_MAPPING = {\n  and_chr: 'chrome',\n  and_ff: 'firefox',\n  ie_mob: 'ie',\n  op_mob: 'opera',\n  and_qq: null,\n "
  },
  {
    "path": "node/build.rs",
    "chars": 137,
    "preview": "#[cfg(not(target_arch = \"wasm32\"))]\nextern crate napi_build;\n\nfn main() {\n  #[cfg(not(target_arch = \"wasm32\"))]\n  napi_b"
  },
  {
    "path": "node/composeVisitors.js",
    "chars": 11393,
    "preview": "// @ts-check\n/** @typedef {import('./index').Visitor} Visitor */\n/** @typedef {import('./index').VisitorFunction} Visito"
  },
  {
    "path": "node/flags.js",
    "chars": 666,
    "preview": "// This file is autogenerated by build-prefixes.js. DO NOT EDIT!\n\nexports.Features = {\n  Nesting: 1,\n  NotSelectorList: "
  },
  {
    "path": "node/index.d.ts",
    "chars": 18604,
    "preview": "import type { Angle, CssColor, Rule, CustomProperty, EnvironmentVariable, Function, Image, LengthValue, MediaQuery, Decl"
  },
  {
    "path": "node/index.js",
    "chars": 1665,
    "preview": "let parts = [process.platform, process.arch];\nif (process.platform === 'linux') {\n  const { MUSL, familySync } = require"
  },
  {
    "path": "node/index.mjs",
    "chars": 276,
    "preview": "import index from './index.js';\n\nconst { transform, transformStyleAttribute, bundle, bundleAsync, browserslistToTargets,"
  },
  {
    "path": "node/src/lib.rs",
    "chars": 2035,
    "preview": "#[cfg(target_os = \"macos\")]\n#[global_allocator]\nstatic GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc;\n\nuse nap"
  },
  {
    "path": "node/targets.d.ts",
    "chars": 867,
    "preview": "// This file is autogenerated by build-prefixes.js. DO NOT EDIT!\n\nexport interface Targets {\n  android?: number,\n  chrom"
  },
  {
    "path": "node/test/bundle.test.mjs",
    "chars": 11123,
    "preview": "import path from 'path';\nimport fs from 'fs';\nimport { test } from 'uvu';\nimport * as assert from 'uvu/assert';\nimport {"
  },
  {
    "path": "node/test/composeVisitors.test.mjs",
    "chars": 20412,
    "preview": "// @ts-check\n\nimport { test } from 'uvu';\nimport * as assert from 'uvu/assert';\nimport {webcrypto as crypto} from 'node:"
  },
  {
    "path": "node/test/customAtRules.mjs",
    "chars": 7085,
    "preview": "// @ts-check\n\nimport { test } from 'uvu';\nimport * as assert from 'uvu/assert';\nimport fs from 'fs';\nimport {webcrypto a"
  },
  {
    "path": "node/test/transform.test.mjs",
    "chars": 1815,
    "preview": "import { test } from 'uvu';\nimport * as assert from 'uvu/assert';\nimport {webcrypto as crypto} from 'node:crypto';\n\nlet "
  },
  {
    "path": "node/test/visitor.test.mjs",
    "chars": 33055,
    "preview": "// @ts-check\n\nimport { test } from 'uvu';\nimport * as assert from 'uvu/assert';\nimport fs from 'fs';\nimport {webcrypto a"
  },
  {
    "path": "node/tsconfig.json",
    "chars": 179,
    "preview": "{\n  \"include\": [\"*.d.ts\"],\n  \"compilerOptions\": {\n    \"lib\": [\"ES2020\"],\n    \"moduleResolution\": \"node\",\n    \"isolatedMo"
  },
  {
    "path": "package.json",
    "chars": 3309,
    "preview": "{\n  \"name\": \"lightningcss\",\n  \"version\": \"1.32.0\",\n  \"license\": \"MPL-2.0\",\n  \"description\": \"A CSS parser, transformer, "
  },
  {
    "path": "patches/@babel+types+7.26.3.patch",
    "chars": 767,
    "preview": "diff --git a/node_modules/@babel/types/lib/retrievers/getBindingIdentifiers.js b/node_modules/@babel/types/lib/retriever"
  },
  {
    "path": "patches/json-schema-to-typescript+11.0.5.patch",
    "chars": 5458,
    "preview": "diff --git a/node_modules/json-schema-to-typescript/dist/src/parser.js b/node_modules/json-schema-to-typescript/dist/src"
  },
  {
    "path": "rust-toolchain.toml",
    "chars": 66,
    "preview": "[toolchain]\nchannel = \"1.92.0\"\ncomponents = [\"rustfmt\", \"clippy\"]\n"
  },
  {
    "path": "rustfmt.toml",
    "chars": 47,
    "preview": "tab_spaces = 2\nchain_width = 80\nmax_width = 115"
  },
  {
    "path": "scripts/build-ast.js",
    "chars": 5846,
    "preview": "const { compileFromFile } = require('json-schema-to-typescript');\nconst fs = require('fs');\nconst recast = require('reca"
  },
  {
    "path": "scripts/build-flow.js",
    "chars": 1082,
    "preview": "const fs = require('fs');\nconst { compiler, beautify } = require('flowgen');\n\nlet dir = `${__dirname}/../`;\nlet contents"
  },
  {
    "path": "scripts/build-npm.js",
    "chars": 4460,
    "preview": "const fs = require('fs');\nconst pkg = require('../package.json');\n\nconst dir = `${__dirname}/..`;\n\n// Add `libc` fields "
  },
  {
    "path": "scripts/build-prefixes.js",
    "chars": 22746,
    "preview": "const { execSync } = require('child_process');\nconst prefixes = require('autoprefixer/data/prefixes');\nconst browsers = "
  },
  {
    "path": "scripts/build-wasm.js",
    "chars": 3048,
    "preview": "const esbuild = require('esbuild');\nconst exec = require('child_process').execSync;\nconst fs = require('fs');\nconst pkg "
  },
  {
    "path": "scripts/build.js",
    "chars": 1264,
    "preview": "const { spawn, execSync } = require('child_process');\n\nlet release = process.argv.includes('--release');\nbuild().catch(("
  },
  {
    "path": "selectors/Cargo.toml",
    "chars": 1018,
    "preview": "[package]\nname = \"parcel_selectors\"\nversion = \"0.28.2\"\nauthors = [\"The Servo Project Developers\"]\ndocumentation = \"https"
  },
  {
    "path": "selectors/LICENSE",
    "chars": 15649,
    "preview": " Mozilla Public License Version 2.0\n==================================\n\n1. Definitions\n--------------\n\n1.1. \"Contributor"
  },
  {
    "path": "selectors/README.md",
    "chars": 1260,
    "preview": "rust-selectors\n==============\n\nThis is a fork of the `selectors` crate, updated to use the latest version of `cssparser`"
  },
  {
    "path": "selectors/attr.rs",
    "chars": 8085,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/bloom.rs",
    "chars": 10914,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/build.rs",
    "chars": 1378,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/builder.rs",
    "chars": 13140,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/context.rs",
    "chars": 8679,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/lib.rs",
    "chars": 750,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/matching.rs",
    "chars": 32127,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/nth_index_cache.rs",
    "chars": 1593,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/parser.rs",
    "chars": 131685,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/serialization.rs",
    "chars": 28143,
    "preview": "use crate::{\n  attr::{\n    AttrSelectorOperator, AttrSelectorWithOptionalNamespace, NamespaceConstraint, ParsedAttrSelec"
  },
  {
    "path": "selectors/sink.rs",
    "chars": 930,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/tree.rs",
    "chars": 4703,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "selectors/visitor.rs",
    "chars": 1863,
    "preview": "/* This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not "
  },
  {
    "path": "src/bundler.rs",
    "chars": 56654,
    "preview": "//! CSS bundling.\n//!\n//! A [Bundler](Bundler) can be used to combine a CSS file and all of its dependencies\n//! into a "
  },
  {
    "path": "src/compat.rs",
    "chars": 151392,
    "preview": "// This file is autogenerated by build-prefixes.js. DO NOT EDIT!\n\nuse crate::targets::Browsers;\n\n#[allow(dead_code)]\n#[d"
  },
  {
    "path": "src/context.rs",
    "chars": 6810,
    "preview": "use std::collections::HashSet;\n\nuse crate::compat::Feature;\nuse crate::declaration::DeclarationBlock;\nuse crate::media_q"
  },
  {
    "path": "src/css_modules.rs",
    "chars": 16863,
    "preview": "//! CSS module exports.\n//!\n//! [CSS modules](https://github.com/css-modules/css-modules) are a way of locally scoping n"
  },
  {
    "path": "src/declaration.rs",
    "chars": 25132,
    "preview": "//! CSS declarations.\n\nuse std::borrow::Cow;\nuse std::ops::Range;\n\nuse crate::context::{DeclarationContext, PropertyHand"
  },
  {
    "path": "src/dependencies.rs",
    "chars": 5130,
    "preview": "//! Dependency analysis.\n//!\n//! Dependencies in CSS can be analyzed using the `analyze_dependencies` option\n//! when pr"
  },
  {
    "path": "src/error.rs",
    "chars": 19371,
    "preview": "//! Error types.\n\nuse crate::properties::custom::Token;\nuse crate::rules::Location;\nuse crate::values::string::CowArcStr"
  },
  {
    "path": "src/lib.rs",
    "chars": 809322,
    "preview": "//! Lightning CSS is a CSS parser, transformer, and minifier based on the\n//! [cssparser](https://github.com/servo/rust-"
  },
  {
    "path": "src/logical.rs",
    "chars": 394,
    "preview": "#[derive(Debug, PartialEq)]\npub enum PropertyCategory {\n  Logical,\n  Physical,\n}\n\nimpl Default for PropertyCategory {\n  "
  },
  {
    "path": "src/macros.rs",
    "chars": 22978,
    "preview": "macro_rules! enum_property {\n  (\n    $(#[$outer:meta])*\n    $vis:vis enum $name:ident {\n      $(\n        $(#[$meta: meta"
  },
  {
    "path": "src/main.rs",
    "chars": 9322,
    "preview": "use atty::Stream;\nuse clap::{ArgGroup, Parser};\nuse lightningcss::bundler::{Bundler, FileProvider};\nuse lightningcss::st"
  },
  {
    "path": "src/media_query.rs",
    "chars": 64276,
    "preview": "//! Media queries.\nuse crate::error::{ErrorWithLocation, MinifyError, MinifyErrorKind, ParserError, PrinterError};\nuse c"
  },
  {
    "path": "src/parser.rs",
    "chars": 37663,
    "preview": "use crate::declaration::{parse_declaration, DeclarationBlock, DeclarationList};\nuse crate::error::{Error, ParserError, P"
  },
  {
    "path": "src/prefixes.rs",
    "chars": 71417,
    "preview": "// This file is autogenerated by build-prefixes.js. DO NOT EDIT!\n\nuse crate::targets::Browsers;\nuse crate::vendor_prefix"
  },
  {
    "path": "src/printer.rs",
    "chars": 13624,
    "preview": "//! CSS serialization and source map generation.\n\nuse crate::css_modules::CssModule;\nuse crate::dependencies::{Dependenc"
  },
  {
    "path": "src/properties/align.rs",
    "chars": 39221,
    "preview": "//! CSS properties related to box alignment.\n\nuse super::flex::{BoxAlign, BoxPack, FlexAlign, FlexItemAlign, FlexLinePac"
  },
  {
    "path": "src/properties/animation.rs",
    "chars": 37810,
    "preview": "//! CSS properties related to keyframe animations.\n\nuse std::borrow::Cow;\n\nuse crate::context::PropertyHandlerContext;\nu"
  },
  {
    "path": "src/properties/background.rs",
    "chars": 35407,
    "preview": "//! CSS properties related to backgrounds.\n\nuse crate::context::PropertyHandlerContext;\nuse crate::declaration::{Declara"
  },
  {
    "path": "src/properties/border.rs",
    "chars": 52671,
    "preview": "//! CSS properties related to borders.\n\nuse super::border_image::*;\nuse super::border_radius::*;\nuse crate::compat::Feat"
  },
  {
    "path": "src/properties/border_image.rs",
    "chars": 18537,
    "preview": "//! CSS properties related to border images.\n\nuse crate::context::PropertyHandlerContext;\nuse crate::declaration::{Decla"
  },
  {
    "path": "src/properties/border_radius.rs",
    "chars": 11615,
    "preview": "//! The CSS border radius property.\n\nuse crate::compat;\nuse crate::context::PropertyHandlerContext;\nuse crate::declarati"
  },
  {
    "path": "src/properties/box_shadow.rs",
    "chars": 7595,
    "preview": "//! The CSS box-shadow property.\n\nuse super::PropertyId;\nuse crate::context::PropertyHandlerContext;\nuse crate::declarat"
  },
  {
    "path": "src/properties/contain.rs",
    "chars": 4725,
    "preview": "//! CSS properties related to containment.\n\n#![allow(non_upper_case_globals)]\n\nuse cssparser::*;\nuse smallvec::SmallVec;"
  },
  {
    "path": "src/properties/css_modules.rs",
    "chars": 3946,
    "preview": "//! Properties related to CSS modules.\n\nuse crate::dependencies::Location;\nuse crate::error::{ParserError, PrinterError}"
  },
  {
    "path": "src/properties/custom.rs",
    "chars": 54822,
    "preview": "//! CSS custom properties and unparsed token values.\n\nuse crate::error::{ParserError, PrinterError, PrinterErrorKind};\nu"
  },
  {
    "path": "src/properties/display.rs",
    "chars": 14338,
    "preview": "//! CSS properties related to display.\n\nuse super::custom::UnparsedProperty;\nuse super::{Property, PropertyId};\nuse crat"
  },
  {
    "path": "src/properties/effects.rs",
    "chars": 13581,
    "preview": "//! CSS properties related to filters and effects.\n\nuse crate::macros::enum_property;\nuse crate::error::{ParserError, Pr"
  },
  {
    "path": "src/properties/flex.rs",
    "chars": 26473,
    "preview": "//! CSS properties related to flexbox layout.\n\nuse super::align::{\n  AlignContent, AlignItems, AlignSelf, ContentDistrib"
  },
  {
    "path": "src/properties/font.rs",
    "chars": 31237,
    "preview": "//! CSS properties related to fonts.\n\nuse std::collections::HashSet;\n\nuse super::{Property, PropertyId};\nuse crate::comp"
  },
  {
    "path": "src/properties/grid.rs",
    "chars": 60021,
    "preview": "//! CSS properties related to grid layout.\n\n#![allow(non_upper_case_globals)]\n\nuse crate::context::PropertyHandlerContex"
  },
  {
    "path": "src/properties/list.rs",
    "chars": 12926,
    "preview": "//! CSS properties related to lists and counters.\n\nuse super::{Property, PropertyId};\nuse crate::context::PropertyHandle"
  },
  {
    "path": "src/properties/margin_padding.rs",
    "chars": 16995,
    "preview": "use crate::compat::Feature;\nuse crate::context::PropertyHandlerContext;\nuse crate::declaration::{DeclarationBlock, Decla"
  },
  {
    "path": "src/properties/masking.rs",
    "chars": 39551,
    "preview": "//! CSS properties related to clipping and masking.\n\nuse super::background::{BackgroundRepeat, BackgroundSize};\nuse supe"
  },
  {
    "path": "src/properties/mod.rs",
    "chars": 68885,
    "preview": "//! CSS property values.\n//!\n//! Each property provides parsing and serialization support using the [Parse](super::trait"
  },
  {
    "path": "src/properties/outline.rs",
    "chars": 1921,
    "preview": "//! CSS properties related to outlines.\n\nuse super::border::{BorderSideWidth, GenericBorder, LineStyle};\nuse super::{Pro"
  },
  {
    "path": "src/properties/overflow.rs",
    "chars": 3801,
    "preview": "//! CSS properties related to overflow.\n\nuse super::{Property, PropertyId};\nuse crate::compat::Feature;\nuse crate::conte"
  },
  {
    "path": "src/properties/position.rs",
    "chars": 4472,
    "preview": "//! CSS properties related to positioning.\n\nuse super::Property;\nuse crate::context::PropertyHandlerContext;\nuse crate::"
  },
  {
    "path": "src/properties/prefix_handler.rs",
    "chars": 5546,
    "preview": "#![allow(non_snake_case)]\nuse super::{Property, PropertyId};\nuse crate::context::PropertyHandlerContext;\nuse crate::decl"
  },
  {
    "path": "src/properties/size.rs",
    "chars": 19370,
    "preview": "//! CSS properties related to box sizing.\n\nuse crate::compat::Feature;\nuse crate::context::PropertyHandlerContext;\nuse c"
  },
  {
    "path": "src/properties/svg.rs",
    "chars": 10241,
    "preview": "//! CSS properties used in SVG.\n\nuse crate::error::{ParserError, PrinterError};\nuse crate::macros::enum_property;\nuse cr"
  },
  {
    "path": "src/properties/text.rs",
    "chars": 49289,
    "preview": "//! CSS properties related to text.\n\n#![allow(non_upper_case_globals)]\n\nuse super::{Property, PropertyId};\nuse crate::co"
  },
  {
    "path": "src/properties/transform.rs",
    "chars": 57803,
    "preview": "//! CSS properties related to 2D and 3D transforms.\n\nuse super::{Property, PropertyId};\nuse crate::context::PropertyHand"
  },
  {
    "path": "src/properties/transition.rs",
    "chars": 20593,
    "preview": "//! CSS properties related to transitions.\n\nuse super::{Property, PropertyId};\nuse crate::compat;\nuse crate::context::Pr"
  },
  {
    "path": "src/properties/ui.rs",
    "chars": 17266,
    "preview": "//! CSS properties related to user interface.\n\nuse crate::context::PropertyHandlerContext;\nuse crate::declaration::{Decl"
  },
  {
    "path": "src/rules/container.rs",
    "chars": 17331,
    "preview": "//! The `@container` rule.\n\nuse cssparser::*;\n\nuse super::Location;\nuse super::{CssRuleList, MinifyContext};\nuse crate::"
  },
  {
    "path": "src/rules/counter_style.rs",
    "chars": 1419,
    "preview": "//! The `@counter-style` rule.\n\nuse super::Location;\nuse crate::declaration::DeclarationBlock;\nuse crate::error::Printer"
  },
  {
    "path": "src/rules/custom_media.rs",
    "chars": 1353,
    "preview": "//! The `@custom-media` rule.\n\nuse super::Location;\nuse crate::error::PrinterError;\nuse crate::media_query::MediaList;\nu"
  },
  {
    "path": "src/rules/document.rs",
    "chars": 1842,
    "preview": "//! The `@-moz-document` rule.\n\nuse super::Location;\nuse super::{CssRuleList, MinifyContext};\nuse crate::error::{MinifyE"
  },
  {
    "path": "src/rules/font_face.rs",
    "chars": 18005,
    "preview": "//! The `@font-face` rule.\n\nuse super::Location;\nuse crate::error::{ParserError, PrinterError};\nuse crate::macros::enum_"
  },
  {
    "path": "src/rules/font_feature_values.rs",
    "chars": 9678,
    "preview": "//! The `@font-feature-values` rule.\n\nuse super::Location;\nuse crate::error::{ParserError, PrinterError};\nuse crate::par"
  },
  {
    "path": "src/rules/font_palette_values.rs",
    "chars": 13292,
    "preview": "//! The `@font-palette-values` rule.\n\nuse super::supports::SupportsRule;\nuse super::{CssRule, CssRuleList, Location, Min"
  },
  {
    "path": "src/rules/import.rs",
    "chars": 2715,
    "preview": "//! The `@import` rule.\n\nuse super::layer::LayerName;\nuse super::supports::SupportsCondition;\nuse super::Location;\nuse c"
  },
  {
    "path": "src/rules/keyframes.rs",
    "chars": 13433,
    "preview": "//! The `@keyframes` rule.\n\nuse super::supports::SupportsRule;\nuse super::MinifyContext;\nuse super::{CssRule, CssRuleLis"
  },
  {
    "path": "src/rules/layer.rs",
    "chars": 5026,
    "preview": "//! The `@layer` rule.\n\nuse super::{CssRuleList, Location, MinifyContext};\nuse crate::error::{MinifyError, ParserError, "
  },
  {
    "path": "src/rules/media.rs",
    "chars": 2194,
    "preview": "//! The `@media` rule.\n\nuse super::Location;\nuse super::{CssRuleList, MinifyContext};\nuse crate::error::{MinifyError, Pr"
  },
  {
    "path": "src/rules/mod.rs",
    "chars": 42265,
    "preview": "//! CSS rules.\n//!\n//! The [CssRule](CssRule) enum includes all supported rules, and can be used to parse\n//! and serial"
  },
  {
    "path": "src/rules/namespace.rs",
    "chars": 1575,
    "preview": "//! The `@namespace` rule.\n\nuse super::Location;\nuse crate::error::PrinterError;\nuse crate::printer::Printer;\nuse crate:"
  },
  {
    "path": "src/rules/nesting.rs",
    "chars": 3991,
    "preview": "//! The `@nest` rule.\n\nuse smallvec::SmallVec;\n\nuse super::style::StyleRule;\nuse super::Location;\nuse super::MinifyConte"
  },
  {
    "path": "src/rules/page.rs",
    "chars": 11756,
    "preview": "//! The `@page` rule.\n\nuse super::Location;\nuse crate::declaration::{parse_declaration, DeclarationBlock};\nuse crate::er"
  },
  {
    "path": "src/rules/property.rs",
    "chars": 6314,
    "preview": "//! The `@property` rule.\n\nuse super::Location;\n#[cfg(feature = \"visitor\")]\nuse crate::visitor::Visit;\nuse crate::{\n  er"
  },
  {
    "path": "src/rules/scope.rs",
    "chars": 3526,
    "preview": "//! The `@scope` rule.\n\nuse super::Location;\nuse super::{CssRuleList, MinifyContext};\nuse crate::error::{MinifyError, Pr"
  },
  {
    "path": "src/rules/starting_style.rs",
    "chars": 1762,
    "preview": "//! The `@starting-style` rule.\n\nuse super::Location;\nuse super::{CssRuleList, MinifyContext};\nuse crate::error::{Minify"
  },
  {
    "path": "src/rules/style.rs",
    "chars": 9594,
    "preview": "//! Style rules.\n\nuse std::hash::{Hash, Hasher};\nuse std::ops::Range;\n\nuse super::Location;\nuse super::MinifyContext;\nus"
  },
  {
    "path": "src/rules/supports.rs",
    "chars": 13872,
    "preview": "//! The `@supports` rule.\n\nuse std::collections::HashMap;\n\nuse super::Location;\nuse super::{CssRuleList, MinifyContext};"
  },
  {
    "path": "src/rules/unknown.rs",
    "chars": 1752,
    "preview": "//! An unknown at-rule.\n\nuse super::Location;\nuse crate::error::PrinterError;\nuse crate::printer::Printer;\nuse crate::pr"
  },
  {
    "path": "src/rules/view_transition.rs",
    "chars": 6176,
    "preview": "//! The `@view-transition` rule.\n\nuse super::Location;\nuse crate::error::{ParserError, PrinterError};\nuse crate::printer"
  },
  {
    "path": "src/rules/viewport.rs",
    "chars": 1487,
    "preview": "//! The `@viewport` rule.\n\nuse super::Location;\nuse crate::declaration::DeclarationBlock;\nuse crate::error::PrinterError"
  },
  {
    "path": "src/selector.rs",
    "chars": 81889,
    "preview": "//! CSS selectors.\n\nuse crate::compat::Feature;\nuse crate::error::{ParserError, PrinterError, SelectorError};\nuse crate:"
  },
  {
    "path": "src/serialization.rs",
    "chars": 965,
    "preview": "#![allow(non_snake_case)]\n\nmacro_rules! wrapper {\n  ($name: ident, $value: ident $(, $t: ty)?) => {\n    #[derive(serde::"
  },
  {
    "path": "src/stylesheet.rs",
    "chars": 14514,
    "preview": "//! CSS style sheets and style attributes.\n//!\n//! A [StyleSheet](StyleSheet) represents a `.css` file or `<style>` elem"
  },
  {
    "path": "src/targets.rs",
    "chars": 11278,
    "preview": "//! Browser target options.\n\n#![allow(missing_docs)]\n\nuse std::borrow::Borrow;\n\nuse crate::vendor_prefix::VendorPrefix;\n"
  },
  {
    "path": "src/test_helpers.rs",
    "chars": 1978,
    "preview": "use crate::error::{Error, ErrorLocation};\n\npub(crate) fn format_source_location_context(source: &str, loc: &ErrorLocatio"
  },
  {
    "path": "src/traits.rs",
    "chars": 12217,
    "preview": "//! Traits for parsing and serializing CSS.\n\nuse crate::context::PropertyHandlerContext;\nuse crate::declaration::{Declar"
  },
  {
    "path": "src/values/alpha.rs",
    "chars": 1344,
    "preview": "//! CSS alpha values, used to represent opacity.\n\nuse super::percentage::NumberOrPercentage;\nuse crate::error::{ParserEr"
  },
  {
    "path": "src/values/angle.rs",
    "chars": 8598,
    "preview": "//! CSS angle values.\n\nuse super::calc::Calc;\nuse super::length::serialize_dimension;\nuse super::number::CSSNumber;\nuse "
  },
  {
    "path": "src/values/calc.rs",
    "chars": 34590,
    "preview": "//! Mathematical calculation functions and expressions.\n\nuse crate::compat::Feature;\nuse crate::error::{ParserError, Pri"
  },
  {
    "path": "src/values/color.rs",
    "chars": 113143,
    "preview": "//! CSS color values.\n\n#![allow(non_upper_case_globals)]\n\nuse super::angle::Angle;\nuse super::calc::Calc;\nuse super::num"
  },
  {
    "path": "src/values/easing.rs",
    "chars": 7420,
    "preview": "//! CSS easing functions.\n\nuse crate::error::{ParserError, PrinterError};\nuse crate::printer::Printer;\nuse crate::traits"
  },
  {
    "path": "src/values/gradient.rs",
    "chars": 50863,
    "preview": "//! CSS gradient values.\n\nuse super::angle::{Angle, AnglePercentage};\nuse super::color::{ColorFallbackKind, CssColor};\nu"
  },
  {
    "path": "src/values/ident.rs",
    "chars": 9575,
    "preview": "//! CSS identifiers.\n\nuse crate::error::{ParserError, PrinterError};\nuse crate::printer::Printer;\nuse crate::properties:"
  },
  {
    "path": "src/values/image.rs",
    "chars": 16361,
    "preview": "//! CSS image values.\n\nuse super::color::ColorFallbackKind;\nuse super::gradient::*;\nuse super::resolution::Resolution;\nu"
  },
  {
    "path": "src/values/length.rs",
    "chars": 27129,
    "preview": "//! CSS length values.\n\nuse super::angle::impl_try_from_angle;\nuse super::calc::{Calc, MathFunction};\nuse super::number:"
  },
  {
    "path": "src/values/mod.rs",
    "chars": 1490,
    "preview": "//! Common [CSS values](https://www.w3.org/TR/css3-values/) used across many properties.\n//!\n//! Each value provides par"
  },
  {
    "path": "src/values/number.rs",
    "chars": 3291,
    "preview": "//! CSS number values.\n\nuse super::angle::impl_try_from_angle;\nuse super::calc::Calc;\nuse crate::error::{ParserError, Pr"
  },
  {
    "path": "src/values/percentage.rs",
    "chars": 14731,
    "preview": "//! CSS percentage values.\n\nuse super::angle::{impl_try_from_angle, Angle};\nuse super::calc::{Calc, MathFunction};\nuse s"
  },
  {
    "path": "src/values/position.rs",
    "chars": 13573,
    "preview": "//! CSS position values.\n\nuse super::length::LengthPercentage;\nuse super::percentage::Percentage;\nuse crate::error::{Par"
  },
  {
    "path": "src/values/ratio.rs",
    "chars": 1851,
    "preview": "//! CSS ratio values.\n\nuse super::number::CSSNumber;\nuse crate::error::{ParserError, PrinterError};\nuse crate::printer::"
  },
  {
    "path": "src/values/rect.rs",
    "chars": 3554,
    "preview": "//! Generic values for four sided properties.\n\nuse crate::error::{ParserError, PrinterError};\nuse crate::printer::Printe"
  },
  {
    "path": "src/values/resolution.rs",
    "chars": 2977,
    "preview": "//! CSS resolution values.\n\nuse super::length::serialize_dimension;\nuse super::number::CSSNumber;\nuse crate::compat::Fea"
  },
  {
    "path": "src/values/shape.rs",
    "chars": 10217,
    "preview": "//! CSS shape values for masking and clipping.\n\nuse super::length::LengthPercentage;\nuse super::position::Position;\nuse "
  },
  {
    "path": "src/values/size.rs",
    "chars": 1561,
    "preview": "//! Generic values for two component properties.\n\nuse crate::error::{ParserError, PrinterError};\nuse crate::printer::Pri"
  },
  {
    "path": "src/values/string.rs",
    "chars": 10828,
    "preview": "//! Types used to represent strings.\n\nuse crate::traits::{Parse, ToCss};\n#[cfg(feature = \"visitor\")]\nuse crate::visitor:"
  },
  {
    "path": "src/values/syntax.rs",
    "chars": 21278,
    "preview": "//! CSS syntax strings\n\nuse super::ident::Ident;\nuse super::number::{CSSInteger, CSSNumber};\nuse crate::error::{ParserEr"
  },
  {
    "path": "src/values/time.rs",
    "chars": 5585,
    "preview": "//! CSS time values.\n\nuse super::angle::impl_try_from_angle;\nuse super::calc::Calc;\nuse super::number::CSSNumber;\nuse cr"
  },
  {
    "path": "src/values/url.rs",
    "chars": 3969,
    "preview": "//! CSS url() values.\n\nuse crate::dependencies::{Dependency, Location, UrlDependency};\nuse crate::error::{ParserError, P"
  },
  {
    "path": "src/vendor_prefix.rs",
    "chars": 4795,
    "preview": "//! Vendor prefixes.\n\n#![allow(non_upper_case_globals)]\n\nuse crate::error::PrinterError;\nuse crate::printer::Printer;\nus"
  },
  {
    "path": "src/visitor.rs",
    "chars": 12686,
    "preview": "//! Visitors for traversing the values in a StyleSheet.\n//!\n//! The [Visitor](Visitor) trait includes methods for visiti"
  },
  {
    "path": "static-self/Cargo.toml",
    "chars": 614,
    "preview": "[package]\nname = \"static-self\"\nversion = \"0.1.2\"\nedition = \"2021\"\nauthors = [\"Devon Govett <devongovett@gmail.com>\",\"Don"
  },
  {
    "path": "static-self/src/lib.rs",
    "chars": 3523,
    "preview": "pub use static_self_derive::IntoOwned;\n\n/// A trait for things that can be cloned with a new lifetime.\n///\n/// `'any` li"
  },
  {
    "path": "static-self-derive/Cargo.toml",
    "chars": 527,
    "preview": "[package]\nname = \"static-self-derive\"\nversion = \"0.1.1\"\nedition = \"2021\"\nauthors = [\"Devon Govett <devongovett@gmail.com"
  },
  {
    "path": "static-self-derive/src/into_owned.rs",
    "chars": 5372,
    "preview": "use proc_macro::{self, TokenStream};\nuse proc_macro2::Span;\nuse quote::quote;\nuse syn::{parse_macro_input, parse_quote, "
  },
  {
    "path": "static-self-derive/src/lib.rs",
    "chars": 182,
    "preview": "use proc_macro::TokenStream;\n\nmod into_owned;\n\n#[proc_macro_derive(IntoOwned)]\npub fn derive_into_owned(input: TokenStre"
  },
  {
    "path": "test-integration.mjs",
    "chars": 4716,
    "preview": "import puppeteer from 'puppeteer';\nimport fetch from 'node-fetch';\nimport assert from 'assert';\nimport {diff} from 'jest"
  },
  {
    "path": "test.js",
    "chars": 1612,
    "preview": "const css = require('./');\nconst fs = require('fs');\n\nif (process.argv[process.argv.length - 1] !== __filename) {\n  let "
  },
  {
    "path": "tests/cli_integration_tests.rs",
    "chars": 19493,
    "preview": "use assert_cmd::prelude::*;\nuse assert_fs::fixture::FixtureError;\nuse assert_fs::prelude::*;\nuse indoc::indoc;\nuse light"
  },
  {
    "path": "tests/test_cssom.rs",
    "chars": 13011,
    "preview": "use lightningcss::{\n  declaration::DeclarationBlock,\n  properties::{Property, PropertyId},\n  stylesheet::{ParserOptions,"
  },
  {
    "path": "tests/test_custom_parser.rs",
    "chars": 3283,
    "preview": "use cssparser::*;\nuse lightningcss::{\n  declaration::DeclarationBlock,\n  error::{ParserError, PrinterError},\n  printer::"
  },
  {
    "path": "tests/test_serde.rs",
    "chars": 522,
    "preview": "#[cfg(feature = \"serde\")]\nuse lightningcss::stylesheet::{ParserOptions, StyleSheet};\n\n#[cfg(feature = \"serde\")]\n#[test]\n"
  },
  {
    "path": "tests/testdata/a.css",
    "chars": 40,
    "preview": "@import \"b.css\";\n\n.a {\n  width: 32px;\n}\n"
  },
  {
    "path": "tests/testdata/apply.css",
    "chars": 49,
    "preview": "@import \"./mixin.css\";\n\n.foo {\n  @apply color;\n}\n"
  },
  {
    "path": "tests/testdata/b.css",
    "chars": 37,
    "preview": ".b {\n  height: calc(100vh - 64px);\n}\n"
  },
  {
    "path": "tests/testdata/baz.css",
    "chars": 21,
    "preview": ".baz { color: blue; }"
  },
  {
    "path": "tests/testdata/foo.css",
    "chars": 54,
    "preview": "@import 'root:hello/world.css';\n\n.foo { color: red; }\n"
  },
  {
    "path": "tests/testdata/has_external.css",
    "chars": 128,
    "preview": "@import url('https://fonts.googleapis.com/css2?family=Roboto&display=swap');\n@import './does_not_exist.css';\n@import './"
  },
  {
    "path": "tests/testdata/hello/world.css",
    "chars": 48,
    "preview": "@import 'root:baz.css';\n\n.bar { color: green; }\n"
  },
  {
    "path": "tests/testdata/mixin.css",
    "chars": 65,
    "preview": "@mixin color {\n  color: red;\n\n  &.bar {\n    color: yellow;\n  }\n}\n"
  },
  {
    "path": "wasm/.gitignore",
    "chars": 96,
    "preview": "*.d.ts\n*.wasm\n*.cjs\npackage.json\nREADME.md\nbrowserslistToTargets.js\nflags.js\ncomposeVisitors.js\n"
  },
  {
    "path": "wasm/async.mjs",
    "chars": 2673,
    "preview": "let cur_await_promise_sync;\nexport function await_promise_sync(promise_addr, result_addr, error_addr) {\n  cur_await_prom"
  },
  {
    "path": "wasm/import.meta.url-polyfill.js",
    "chars": 302,
    "preview": "/**\n * @see https://github.com/evanw/esbuild/issues/1633\n */\nexport const import_meta_url =\n  typeof document === 'undef"
  },
  {
    "path": "wasm/index.mjs",
    "chars": 3342,
    "preview": "import { Environment, napi } from 'napi-wasm';\nimport { await_promise_sync, createBundleAsync } from './async.mjs';\n\nlet"
  },
  {
    "path": "wasm/wasm-node.mjs",
    "chars": 2204,
    "preview": "import { Environment, napi } from 'napi-wasm';\nimport { await_promise_sync, createBundleAsync } from './async.mjs';\nimpo"
  },
  {
    "path": "website/.posthtmlrc",
    "chars": 532,
    "preview": "{\n  \"plugins\": {\n    \"posthtml-include\": {},\n    \"posthtml-markdownit\": {\n      \"markdownit\": {\n        \"html\": true\n   "
  }
]

// ... and 19 more files (download for full content)

About this extraction

This page contains the full source code of the parcel-bundler/lightningcss GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 219 files (3.6 MB), approximately 948.1k tokens, and a symbol index with 3700 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!