cms-alchemy/textsize-control
最新稳定版本:v1.0.1
Composer 安装命令:
composer require cms-alchemy/textsize-control
包简介
Drupal module providing dynamic user-controlled text scaling with intelligent fallback strategies.
README 文档
README
A lightweight Drupal module that provides user-adjustable text scaling with intelligent fallback strategies.
This module adds a small floating UI (A- / A / A+) that allows users to dynamically adjust text size across the site. It is designed to work across a wide range of themes, including those that rely on rem, em, or fixed px units.
Installation
composer require cms-alchemy/textsize-control
drush en textsize_control
Features
- Persistent text scaling via
localStorage - Three scaling strategies:
- Root font-size scaling (preferred)
- Class-based scaling fallback
- Transform-based scaling (last resort)
- Automatic detection of whether scaling is effective
- Minimal UI injected on page load
- No configuration required
How It Works
The module attaches a Drupal behavior that:
- Injects a control UI into the page (
A-,A,A+) - Tracks the current scale and mode in
localStorage - Applies scaling using a CSS variable (
--text-scale) - Attempts scaling in this order:
- Root (
html { font-size }) - Class-based (
.textsize-mode-class) - Transform (
scale())
- Root (
If root scaling does not visibly affect the page, the module automatically falls back to alternative methods.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2026-03-30