
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@cosmic-design/style
Advanced tools
/** package.json */
{
"exports": {
"./*": "./dist/*", /** compiled css **/
"./common": "./src/common" /** souce code css **/
},
}
.
├── dist
│ ├── utilities.css # Tool CSS
│ ├── button.module.css # Component CSS, including default & prefab style
│ ├── global.css # Global CSS = Tool CSS + CSS Variables
├── src
│ ├── common
│ │ ├── theme.css # CSS Variables
以下内容为组件代码库引用 @cosmic-design/style 的方式
import style "@cosmic-design/style/button.module.css";
;import style from '@cosmic-design/style/button.modules.css';
const ButtonTemplate = `<div class="${style.button} cos-sm"></div>`
以下内容为组件/业务代码库,如何使用工具样式/组件样式
<!-- 使用组件的变体修饰 -->
<button class="cos-lg" >大号按钮</button>
<!-- 使用组件的变体修饰 -->
<button class="cos-rounded" >放行按钮</button>
<!-- 使用组件的预制修饰 -->
<button class="cos-dashed" >描边按钮</button>
衍生外观的实现位于 component/Button/button-dashed.module.less 中,编译时打包到 dist/button.module.css 中。
目前在 vite.config.js 中对 CSS Module 编译进行了基本配置
{
modules: {
scopeBehaviour: 'local', // 默认配置, 全局样式需要加 :global() 来避免className编译
localsConvention: 'camelCase', // js的产出中增加驼峰变量名,以便于 style.buttonPrefix 方式引用
generateScopedName: "cos-[local]" // className 编译规则, 目前cos-前缀在这里统一添加
}
}
FAQs
## Exports
The npm package @cosmic-design/style receives a total of 213 weekly downloads. As such, @cosmic-design/style popularity was classified as not popular.
We found that @cosmic-design/style demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.