
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
@x-edu/all-theme
Advanced tools
[UI 规范说明](https://www.figma.com/design/lWdVoxs1kfi0SzRXCP1C49/%E8%81%9A%E5%90%88%E5%90%8E%E5%8F%B0%E6%94%B9%E7%89%88%E8%AE%BE%E8%AE%A1-%E5%BC%A0%E8%95%8A?node-id=4408-41026)
npm install @x-edu/all-theme
@import '@x-edu/all-theme/dist/default/index.less';
import '@x-edu/all-theme/dist/default/index.less'
import themeVariable from '@x-edu/all-theme/dist/default/index.js';
目前只有一个主题:
default
。注意:对于非 Fish 4 实现的部分,在引入 LESS 文件后,请根据 UI 规范使用变量覆盖样式。
下面开始处理 Fish 4 的组件样式:
gem-mine.config.js
中设置 css.loaderOptions:// 引入 JSON 格式的样式变量
const themeVars = require('@x-edu/all-theme/dist/default/index.js')
module.exports = {
css: {
loaderOptions: {
less: {
lessOptions: {
modifyVars: themeVars,
javascriptEnabled: true
}
}
}
}
}
webpack.config.js
中通过 less-loader 配置:// 引入 JSON 格式的样式变量
const themeVars = require('@x-edu/all-theme/dist/default/index.js')
module.exports = {
rules: [{
test: /\.less$/,
use: [
'style-loader',
'css-loader',
{
loader: 'less-loader',
options: {
lessOptions: {
modifyVars: themeVars,
javascriptEnabled: true
}
}
}
]
}]
}
存在覆盖 Fish 变量后,依然无法达到 UI 预期效果的情况,需要引入主题样式对 Fish 组件进行额外的样式覆写。
@x-edu/all-theme 提供了两个 API:
import { applyTheme, removeTheme } from '@x-edu/all-theme';
// 默认 'body'
// 应用主题
applyTheme('default');
// 如果需要移除主题
// removeTheme('default');
// id="root"
// applyTheme('default', '#root');
// removeTheme('default', '#root');
保证在期望生效页面正确引入即可。如果希望全局生效,请在项目入口文件或全局生效的 LESS 文件中引入。
@import '@x-edu/all-theme/dist/default/index.less';
import '@x-edu/all-theme/dist/default/index.less'
引入 @x-edu/all-theme 对 Fish4 的样式覆盖效果
applyTheme
设置主题,如果设置成功,对应的元素会有类名 'x-edu-all-theme-default'。可能存在某些场景未提供支持的情况,可以通过提供的 反馈表 提交问题,以便后续更新和完善。
FAQs
[UI 规范说明](https://www.figma.com/design/lWdVoxs1kfi0SzRXCP1C49/%E8%81%9A%E5%90%88%E5%90%8E%E5%8F%B0%E6%94%B9%E7%89%88%E8%AE%BE%E8%AE%A1-%E5%BC%A0%E8%95%8A?node-id=4408-41026)
We found that @x-edu/all-theme demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.