cms-alchemy/textsize-control 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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:

  1. Injects a control UI into the page (A-, A, A+)
  2. Tracks the current scale and mode in localStorage
  3. Applies scaling using a CSS variable (--text-scale)
  4. Attempts scaling in this order:
    • Root (html { font-size })
    • Class-based (.textsize-mode-class)
    • Transform (scale())

If root scaling does not visibly affect the page, the module automatically falls back to alternative methods.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 6
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2026-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固