重要
维生素当前版本将不再进化,现在只接受错误修复。更多信息请参阅此处。
维生素 iOS
为 iOS 和 iPadOS 应用程序设计的 Decathlon 设计系统库
简介
Decathlon 设计系统是我们生态系统设计和发展一致且高质量的体验的框架。
对于其数字章节,它被称为 Vitamin。
安装
SPM
将 Vitamin 添加到你的包的依赖数组中
dependencies: [
.package(url: "https://github.com/Decathlon/vitamin-ios.git", .exact("0.13.0")),
// Any other dependencies...
],
然后,将 Vitamin 添加到任何依赖于 Vitamin 的目标依赖数组中。
对于 SwiftUI
.target(name: "YourSwiftUITarget",
dependencies: [
.product(name: "VitaminSwiftUI", package: "vitamin-ios"),
// Any other dependencies...
]),
对于 UIKit
.target(name: "YourUIKitTarget",
dependencies: [
.product(name: "Vitamin", package: "vitamin-ios"),
// Any other dependencies...
]),
完整的示例
let package = Package(
name: "YourPackage",
products: [
// Your products
],
dependencies: [
.package(url: "https://github.com/Decathlon/vitamin-ios.git", .exact("0.13.0")),
// Any other dependencies...
],
targets: [
// Your target
.target(name: "YourUIKitTarget",
dependencies: [
.product(name: "Vitamin", package: "vitamin-ios"),
// Any other dependencies...
]),
.target(name: "YourSwiftUITarget",
dependencies: [
.product(name: "VitaminSwiftUI", package: "vitamin-ios"),
// Any other dependencies...
]),
]
)
Cocoapods
# for UIKitVersion
pod 'Vitamin', '= 0.13.0'
# for SwiftUI version
pod 'VitaminSwiftUI', = '0.13.0'
可用元素
此库提供两种类型的元素:组件和模块。
组件是 Vitamin 设计系统的核心模块,模块是在组件之上构建的较高层次元素。
组件
以下组件可用
元素 | 描述 | 文档 |
---|---|---|
资产 | 可在设计系统中使用的图形资产集合。 | UIKit SwiftUI |
颜色 | 设计系统的语义和基础颜色。 | UIKit SwiftUI |
图标 | 可在设计系统中使用的图标集合。 | UIKit SwiftUI |
圆角 | 适用于设计系统中任何视图的圆角。 | UIKit SwiftUI |
阴影 | 适用于设计系统中任何视图的阴影。 | UIKit SwiftUI |
字体 | 设计系统可用的文本样式。 | UIKit SwiftUI |
组件
以下组件可供使用
组件 | 描述 | 文档 |
---|---|---|
徽章 | Vitamin 设计系统中的徽章。 | UIKit SwiftUI |
按钮 | 来自 Vitamin 设计系统的不同按钮样式。 | UIKit SwiftUI |
进度条 | 来自 Vitamin 设计系统的不同进度条样式。 | UIKit |
分段控件 | Vitamin 设计系统中的分段控件。 | UIKit |
Snack Bar | Vitamin 设计系统中的 Snack Bar。 | UIKit |
开关 | Vitamin 设计系统中的开关。 | UIKit |
标签 | Vitamin 设计系统中的标签。 | UIKit |
文本框 | 来自 Vitamin 设计系统的不同文本框样式。 | UIKit SwiftUI |
特别感谢
感谢参与这些 vitamin-ios 库的 贡献者(即使在它们成为开源之前)。💙
也要感谢 Remix Icon,因为 Vitamix 图标是 Decathlon 的官方图标库,基于他们的 开源图标库(Remix Design © 2020)。此原始库受 Apache 2.0 许可证的保护并被 Decathlon 进行了修改。了解更多。
许可协议
Copyright 2021 Decathlon.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://apache.ac.cn/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.