{"id":13459,"library":"lightningcss-android-arm64","title":"LightningCSS for Android ARM64","description":"LightningCSS is a high-performance CSS parser, transformer, bundler, and minifier, written in Rust. It serves as the core CSS processor within the Parcel bundler and is recognized for its exceptional speed, capable of processing millions of lines of CSS per second on a single thread. The current stable version, 1.32.0, reflects ongoing development with frequent minor and patch releases to support the latest CSS specifications, improve browser compatibility, and fix bugs. Key differentiators include its Rust-native performance, comprehensive support for modern CSS features like CSS Modules, nesting, container queries, view transitions, and its ability to replace several PostCSS plugins. This specific package, `lightningcss-android-arm64`, provides the native ARM64 binary optimized for Android environments, which is typically installed as a transitive dependency when the main `lightningcss` package is used on compatible systems.","status":"active","version":"1.32.0","language":"javascript","source_language":"en","source_url":"https://github.com/parcel-bundler/lightningcss","tags":["javascript"],"install":[{"cmd":"npm install lightningcss-android-arm64","lang":"bash","label":"npm"},{"cmd":"yarn add lightningcss-android-arm64","lang":"bash","label":"yarn"},{"cmd":"pnpm add lightningcss-android-arm64","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"For Node.js, `transform` is a named export. ESM is generally preferred for new projects, but CommonJS `require` is supported for Node.js environments.","wrong":"const transform = require('lightningcss').transform;","symbol":"transform","correct":"import { transform } from 'lightningcss';"},{"note":"`bundle` is used for resolving and inlining `@import` rules, and it requires filesystem access via the `filename` option. It is also a named export.","wrong":"const bundle = require('lightningcss').bundle;","symbol":"bundle","correct":"import { bundle } from 'lightningcss';"},{"note":"The `Features` enum provides flags to enable or disable specific CSS features for transpilation, such as `Nesting` or `Colors`. It's a named export directly from the main package.","wrong":"import { Features } from 'lightningcss/features';","symbol":"Features","correct":"import { transform, Features } from 'lightningcss';"}],"quickstart":{"code":"import { transform, Features } from 'lightningcss';\nimport { readFileSync, writeFileSync } from 'node:fs';\nimport { Buffer } from 'node:buffer';\n\nconst inputCss = `\n  /* Example CSS to transform */\n  :root {\n    --primary-color: #3498db;\n  }\n\n  .container {\n    display: flex;\n    gap: 10px;\n\n    & > .item {\n      background-color: var(--primary-color);\n      padding: 1rem;\n\n      @media (min-width: 768px) {\n        flex-grow: 1;\n      }\n    }\n  }\n`;\n\n// A basic browserslist target for broad compatibility\nconst targets = {\n  chrome: 100 << 16,\n  firefox: 100 << 16,\n  safari: 15 << 16,\n  edge: 100 << 16\n};\n\ntry {\n  const { code, map } = transform({\n    filename: 'input.css',\n    code: Buffer.from(inputCss),\n    minify: true,\n    targets: targets,\n    sourceMap: true,\n    drafts: { nesting: true } // Explicitly enable CSS Nesting draft syntax\n  });\n\n  console.log('Transformed CSS:\\n', code.toString());\n  console.log('\\nSource Map:\\n', map?.toString());\n\n  // Example: Write to files\n  writeFileSync('output.min.css', code);\n  if (map) writeFileSync('output.min.css.map', map);\n  console.log('\\nSuccessfully transformed and minified CSS to output.min.css');\n} catch (error) {\n  console.error('Error transforming CSS:', error);\n}","lang":"typescript","description":"Demonstrates how to use `lightningcss.transform` to minify, transpile for browser targets, and generate a source map for a CSS string, enabling CSS nesting."},"warnings":[{"fix":"Review and update relative color calculations in your CSS to use numbers where percentages were previously expected, as per the updated CSS Color Module Level 5 spec.","message":"The relative color parsing behavior was updated in v1.30.0 to align with the latest CSS spec. Colors now support numbers in addition to percentages, and calculations in colors are always treated as numbers. This can be a breaking change if your code relies on older percentage-based relative color calculations.","severity":"breaking","affected_versions":">=1.30.0"},{"fix":"Update your nested CSS selectors and rules to adhere to the latest CSS Nesting Module specification. Enable the `drafts: { nesting: true }` option in the `transform` or `bundle` API.","message":"The CSS nesting implementation was updated in v1.30.0 to conform to the latest spec. This may affect existing CSS files that use older or non-standard nesting syntax, potentially leading to compilation errors or different output behavior.","severity":"breaking","affected_versions":">=1.30.0"},{"fix":"Install the main `lightningcss` package (`npm install lightningcss` or `pnpm install lightningcss`) and let npm/yarn/pnpm handle the appropriate native binary resolution.","message":"`lightningcss-android-arm64` is a platform-specific native binding. Directly installing this package is usually not necessary; instead, install the main `lightningcss` package, which will automatically resolve and install the correct native binding for your system's architecture (e.g., `lightningcss-android-arm64` for ARM64 Android environments).","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Ensure `lightningcss` is installed on the target architecture. For Docker, specify the correct base image and run `npm install` inside the container. If cross-compiling, ensure the correct native binding is available or explicitly configure for the target platform. Consider clearing `node_modules` and reinstalling.","cause":"This error typically indicates that the native binary for LightningCSS could not be found or loaded for the current operating system and architecture. This can happen in Docker containers, cross-compilation environments, or if the initial installation failed to fetch the correct binding.","error":"Error: Cannot find module '../lightningcss.linux-x64-gnu.node'"},{"fix":"Review the CSS code at the indicated location for syntax errors. If processing third-party CSS with known issues, consider enabling the `errorRecovery: true` option in the `transform` or `bundle` API to skip invalid rules and declarations, converting them to warnings.","cause":"LightningCSS is strict by default and will throw errors on invalid CSS syntax. This can occur with malformed declarations, incorrect at-rules, or non-standard syntax.","error":"CSS parse error: Unexpected token"},{"fix":"Adjust your `cssModules.pattern` configuration to ensure `[local]` is the last placeholder. For example, use `pattern: '[hash]-[local]'` instead of `pattern: '[local]-[hash]'`.","cause":"When using CSS Modules with CSS Grid, and defining custom naming patterns, LightningCSS requires the `[local]` placeholder to be at the end of the `pattern` string to correctly handle auto-generated grid line names (e.g., `-start`, `-end`).","error":"CSS Modules error: [local] must be at the end so that auto-generated grid line names work"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null}