mediawiki/scss
Composer 安装命令:
composer require mediawiki/scss
包简介
Allows using SCSS files for MediaWiki styling
README 文档
README
The MediaWiki SCSS library provides a ResourceLoader module capable of compiling SCSS.
Requirements
Use
An SCSS module is defined much like any other style module. See the manual for
$wgResourceModules.
It should also be possible to add the module definition to the extension.json
of a MediaWiki extension. See
Developing_with_ResourceLoader
Some additional keys may be used:
-
class: This is mandatory. It selects the class to be used for the module. For SCSS, the value has to be'SCSS\\ResourceLoaderSCSSModule' -
styles: It is not an additional key, but it has extended semantics. This key contains the list of the module's style files. Each file can optionally be given a position to influence the order in which the files are compiled. Allowed values for the position arebeforeFunctionsfunctionsafterFunctionsbeforeVariablesvariablesafterVariablesbeforeMainmainafterMain
If no position is given,
mainwill be assumed.All files of one module will be compiled together, i.e., variables, mixins etc., will be shared between them.
-
variables: An array of variables and values to override the SCSS variables in the style files. This allows changing values (e.g., colors, fonts, margins) without having to modify the actual style files. -
cacheTriggers: Compiling SCSS is expensive, so compiled results are cached. This option lists files that, when changed, will trigger flushing of the cache and re-compiling of the style files.All files on this list will be checked for each web request. To minimizes the load on the file system and the time to build the page, it is not advisable to add all style files to this list.
Here is an example definition:
$wgResourceModules[ 'ext.MyExtension.styles' ] = [ 'class' => 'SCSS\\ResourceLoaderSCSSModule', 'localBasePath' => $localBasePath, 'remoteBasePath' => $remoteBasePath, 'position' => 'top', 'styles' => [ 'modules/ext.MyExtension.foo.scss' => 'main', 'modules/ext.MyExtension.bar.scss' ], 'variables' => [ 'red' => '#ff0000', 'green' => '#00ff00', 'blue' => '#0000ff', ], 'cacheTriggers' => [ 'LocalSettings.php', 'composer.lock', ], ];
The extension uses the scssphp/scssphp compiler, which has some limitations. See the issue list.
Cache type
$egScssCacheType can be set to request a specific cache type for the compiled
styles. To disable caching of SCSS styles altogether (e.g., during development),
set $egScssCacheType = CACHE_NONE;. This should never be done on a production
site.
Professional Support
The SCSS extension is maintained by Professional Wiki. You can contract us to help you install or customize SCSS. We also do development work.
Running the tests
The tests can only be run when the library is loaded within MediaWiki.
You can add it via composer.local.json (probably using dev-master).
Inside your MediaWiki root directory
php tests/phpunit/phpunit.php -c vendor/mediawiki/scss/phpunit.xml.dist
License
You can use the SCSS extension under the GNU General Public License, version 3 (or any later version).
Release notes
Version 5.0.0
Released on 2025-12-20
- Raised minimum MediaWiki version from 1.39 to 1.43
- Raised minimum PHP version from 8.0 to 8.1
- Raised minimum
scssphpversion from 1.12.1 to 1.13.0 - Fixed MediaWiki 1.43 deprecations
Version 4.0.0
Released on 2024-04-25
- Raised minimum MediaWiki version from 1.35 to 1.39
- Raised minimum PHP version from 7.4.3 to 8.0
- Raised minimum
scssphpversion from 1.10.2 to 1.12.1 - Modernized coding standards
Version 3.0.1
Released on 2022-07-25
- Added preliminary compatibility with MediaWiki 1.39
Version 3.0.0
Released on 2022-03-30
- Raised minimum MediaWiki version from 1.27 to 1.35
- Raised minimum PHP version from 5.6 to 7.4.3
- Raised minimum
scssphpversion from 1.5.2 to 1.10.2
Version 2.0.8
Released on 2022-07-25
- Added preliminary compatibility with MediaWiki 1.39
Version 2.0.7
Released on 2021-05-18
- Increased minimum version of
scssphp
Version 2.0.6
Released on 2021-05-15
- Temporarily limit the version of
scssphpbelow 1.5 to avoid breaking changes
Version 2.0.5
Released on 2020-12-27
- Added compatibility with MediaWiki 1.36
Version 2.0.4
Released on 2020-09-07
- Switched to new version of
scssphp
Version 2.0.3
Released on 2020-09-07
- Temporarily fixed the version of
scssphpto 1.1.1 to avoid the 1.2 bug
Version 2.0
Released on 2020-04-19
- Turned MediaWiki extension into a standard PHP/Composer library
- Switched to new version of
scssphp
Version 1.0
Released on 2019-04-28
- Initial release
mediawiki/scss 适用场景与选型建议
mediawiki/scss 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 71.32k 次下载、GitHub Stars 达 5, 最近一次更新时间为 2018 年 05 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「sass」 「scss」 「extension」 「wiki」 「mediawiki」 「scssphp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mediawiki/scss 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mediawiki/scss 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mediawiki/scss 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A custom URL rule class for Yii 2 which allows to create translated URL rules
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
UI Kit 3 Extension for Yii2
Adds more BBCode
Zend Framework 3+ module that provides assets bundling / caching
统计信息
- 总下载量: 71.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 22
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2018-05-12