15 个仓库
Plugins and loaders for minifying, extracting, and purging unused CSS styles.
Explore 15 awesome GitHub repositories matching part of an awesome list · CSS Optimization. Refine with filters or upvote what's useful.
Layui is a web UI component library, frontend layout framework, and CSS asset optimizer. It provides a collection of pre-styled visual elements and layout patterns used to build browser-native web interfaces. The framework enables the composition of structured web pages through standardized design assets and CSS components. It includes tools for compressing stylesheets and resolving imports to improve loading speeds across different web browsers. The library covers web UI development and frontend layout composition, facilitating rapid interface prototyping by assembling functional frontends
Includes tools for minifying and optimizing CSS to improve page load times and rendering.
PostCSS is a CSS post-processor and abstract syntax tree transformation tool that parses stylesheets into a structured tree for programmatic analysis and modification. It functions as a plugin-driven pipeline where JavaScript plugins can modify, insert, or delete nodes to transform styles. The project provides a framework for building a custom plugin ecosystem to extend the CSS language with non-standard features such as loops, conditionals, and shorthand properties. It supports multi-syntax parsing through pluggable parsers and stringifiers, allowing it to process various style formats and c
Implements a pipeline for minifying and purging unused CSS styles to optimize website performance.
Linaria is a zero-runtime CSS-in-JS library and static CSS generator. It evaluates JavaScript expressions at build time to extract styles from tagged template literals into standalone, static CSS files, removing the need for a runtime style injection engine. The library distinguishes itself by mapping component props to CSS custom properties, enabling dynamic styling and runtime property updates without regenerating stylesheets. It utilizes a build-time evaluation engine to resolve interpolations and a hashing system to generate scoped class names that prevent style collisions. The project c
Zero-runtime CSS-in-JS library using build-time transformations.
Critical is a tool for extracting and inlining the minimum CSS required to render above-the-fold content. It identifies the styles necessary for the initial visible portion of a page to reduce render-blocking requests and improve page load speed. The project generates resolution-specific stylesheets to optimize the initial paint across different device dimensions. It includes a utility to rebase asset URLs within extracted styles, ensuring that images and fonts load correctly when stylesheets are moved to different directories or content delivery networks. The tool provides a command-line in
Generates tailored stylesheets for different screen dimensions to ensure optimal above-the-fold rendering across various devices.
PurifyCSS is a CSS unused style remover and payload optimizer that analyzes HTML and templates to identify and delete unused CSS selectors from stylesheets. It functions as a frontend build automation tool that integrates into development pipelines to automatically strip redundant styles and minify assets during the compilation phase. The tool provides specific optimization for single page applications, identifying and removing redundant CSS while ensuring necessary styles are preserved across dynamic views and states. The utility covers a range of capabilities including static content analy
Remove unused CSS selectors from stylesheets.
Uncss is a build pipeline CSS optimizer and optimization tool designed to remove unused styles from stylesheets. It analyzes HTML files to identify and strip selectors that do not match any elements in the markup, reducing the final stylesheet size and overall web page weight. The tool functions as a DOM-based CSS analyzer that can simulate runtime document states. It provides mechanisms to preserve required selectors through the use of literal names, regular expressions, and specialized CSS comment markers to ensure styles triggered by user interactions are not deleted. The project supports
Provides a utility for purging unused CSS styles to optimize stylesheet size.
StyleX is a type-safe CSS-in-JS library and atomic CSS compiler that transforms JavaScript style definitions into optimized static CSS and type-safe class names. It functions as a multi-framework styling tool, generating standard CSS assets compatible with various JavaScript UI frameworks and server components. The system includes a CSS design token system and theme engine for managing shared constants and composing visual schemes. It allows for the creation of light, dark, and custom themes through variable overrides and token inheritance. The project covers component styling through object
Optimizes style definitions into minified and efficient CSS to improve loading speeds.
PurgeCSS 是一个构建流水线 CSS 清理和优化工具,旨在减小样式表的最终体积。它作为一种 Tree Shaking 工具,通过扫描 HTML 和 JavaScript 文件来识别并移除 CSS 中未使用的选择器。 该工具通过执行静态内容分析来检测标记中实际使用的样式,从而优化 CSS 有效载荷。它使用基于正则表达式的模式匹配来查找潜在的类名,无需执行代码,并采用基于 PostCSS 的 AST 转换来安全地删除未使用的规则。 该项目提供了前端构建自动化的功能,允许将未使用样式的移除直接集成到模块打包器和任务运行器中。它还包含一个自定义白名单过滤器,无论内容扫描结果如何,都能保留必要的选择器。
Remove unused CSS to reduce file size.
loadCSS 是一个异步 CSS 加载器和非阻塞样式表注入器。它提供了一种技术实现,用于在不阻塞浏览器渲染过程的情况下加载样式表,以保持响应式用户界面。 该项目实现了一种特定的 CSS 加载模式,用于检测异步样式表何时在不同 Web 浏览器中完成加载。这允许仅在样式表完全加载后执行回调函数,以确保视觉行为的一致性。 该工具涵盖程序化样式表插入、基于应用程序逻辑的动态注入以及样式表加载检测。它管理样式请求的方式,以优化前端性能。
Asynchronously load CSS files to prevent render-blocking.
cssnano 是一个 CSS 压缩和精简工具,可减小样式表的文件大小和 gzip 占用空间。它作为构建流水线优化器和代码转换器运行,在删除空格和注释的同时,将颜色和渐变缩短为尽可能小的表示形式。 该工具使用模块化插件架构和基于预设的优化级别,以平衡压缩强度与浏览器兼容性。它允许根据目标支持浏览器列表调整输出,以确保精简后的样式在不同环境中保持兼容。 该项目集成到 PostCSS 流水线和模块打包器中,提供命令行界面和用于构建过程集成的自动化功能。这使得通过自动化的 CSS 精简工作流能够减少总字节大小并降低网络延迟。
Provides advanced CSS optimization by minifying styles and shortening colors and gradients for improved page performance.
North is a responsive web design methodology and Sass-based CSS architecture framework. It provides a system for building mobile-first user interfaces using fluid grids and progressive enhancement techniques to ensure a consistent experience across different browser capabilities and screen sizes. The project features a standardized CSS naming system that uses Sass mixins to programmatically generate class names, distinguishing between components, layouts, and states. It also functions as a frontend project scaffolding tool, providing a generator to bootstrap new environments with pre-configur
Reduces stylesheet bloat by preventing the duplication of properties across selectors.
这是一个 Webpack 扩展,用于将 CSS 从 JavaScript 文件中提取到独立的样式表中,以用于生产构建。它作为一个 CSS 打包器和资产优化器,将样式与脚本包分离,以实现并行加载并防止出现无样式内容闪烁(FOUC)。 该项目提供了用于生成将本地样式定义映射到应用程序组件的 JavaScript 模块导出的实用工具。它还通过资源查询条件加载不同的 CSS 变体来实现动态主题管理,并支持通过使用内容哈希文件名进行长期浏览器缓存。 能力领域涵盖了通过异步按需样式获取进行的前端性能调优,以及服务端渲染(SSR)优化,包括样式内联和重复标签预防。该工具还支持具有热模块替换(HMR)的开发工作流,以实现即时样式更新。 该插件集成到 Webpack 构建流水线中,并提供用于输出文件名模式和生命周期钩子的配置选项,以定制样式链接标签的生成。
Optimizes CSS delivery by extracting styles from JS to enable parallel loading and prevent FOUC.
该项目是一个跨平台移动端项目模板和 TypeScript 样板,专为使用 Expo 生态系统引导 React Native 应用而设计。它提供了一个预配置的架构和标准化的文件夹结构,以加速初始开发。 该模板的独特之处在于其基于功能的项目架构和全面的自动化套件。它集成了用于导航的基于文件的路由、用于样式的实用优先(utility-first)移动端 UI 库,以及用于获取和缓存远程 API 数据的服务端状态管理层。该设置包括使用 GitHub Actions 和 EAS 的移动端 CI/CD 流水线,以自动化构建、测试和分发应用二进制文件。 更广泛的功能面涵盖了基于模式的表单验证、用于会话持久化的加密本地存储,以及带有翻译文件验证的多语言本地化。它还整合了质量强制工具,包括用于 Lint 和类型检查的 git hooks,以及自动化的单元测试和端到端 UI 测试。
Scans styles to prevent unknown classes and unnecessary whitespace in utility-first CSS implementations.
astroturf lets you write CSS in your JavaScript files without adding any runtime layer, and with your existing CSS processing pipeline.
Zero-runtime CSS-in-JS library that extracts styles to CSS files.
analyze-css
Analyze CSS complexity and identify performance bottlenecks.