Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#124] Update color semantic tokens #198

Merged
merged 31 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8c8aec4
refactor: remove color alias semantic tokens and optional types
pylapp Oct 15, 2024
eabcced
refactor: update of color semantic tokens
pylapp Oct 15, 2024
ca0876f
refactor: update of color semantic tokens (`colorBackgroundStatusPosi…
pylapp Oct 15, 2024
f267a67
refactor: update of color semantic tokens (`colorBackgroundStatusWarn…
pylapp Oct 15, 2024
db5e5e1
refactor: update of color semantic tokens (`colorBackgroundStatusNega…
pylapp Oct 15, 2024
858544b
refactor: update of color semantic tokens (`colorBackgroundStatusAcce…
pylapp Oct 15, 2024
fb65663
refactor: update of color semantic tokens (`colorContentStatus*`)
pylapp Oct 15, 2024
665027e
refactor: update of color semantic tokens (`colorContentOnBackgroundS…
pylapp Oct 16, 2024
3d2f009
refactor: update of color semantic tokens (`colorContentOnBackgroundS…
pylapp Oct 16, 2024
f9eed45
refactor: update of color semantic tokens (`colorContentOnBackgroundS…
pylapp Oct 16, 2024
9a87acc
refactor: update of color semantic tokens (`colorContentOnBackgroundS…
pylapp Oct 16, 2024
0413b61
refactor: update of color semantic tokens (`colorContentOnBackgroundS…
pylapp Oct 16, 2024
67639fb
refactor: update of color semantic tokens (`colorBorder*`)
pylapp Oct 16, 2024
46d13cd
refactor: use of fatalError() if missing raw tokens instead of hard-c…
pylapp Oct 16, 2024
e3da3da
feat: add of color semantic tokens (`colorAction*`)
pylapp Oct 16, 2024
df8b048
feat: add of color semantic tokens (`colorAction*`)
pylapp Oct 16, 2024
07caf60
feat: add of color semantic tokens (`colorAlways*`)
pylapp Oct 16, 2024
477a11b
feat: add of color semantic tokens (`colorTransparent*`)
pylapp Oct 16, 2024
ad2eea2
feat: add of color semantic tokens (`colorElevation*`)
pylapp Oct 16, 2024
6015028
feat: add of color semantic tokens (`colorDecorative*`)
pylapp Oct 16, 2024
1cbc839
feat: add of color semantic tokens (`colorChart*`)
pylapp Oct 16, 2024
9b4b7d6
chore: clean up
pylapp Oct 16, 2024
ad6ccbb
chore: improve rules for SwitLint
pylapp Oct 16, 2024
44e99c4
chore: clean up
pylapp Oct 16, 2024
e941828
chore: clean up
pylapp Oct 16, 2024
846fef6
chore: clean up
pylapp Oct 16, 2024
b120139
chore: clean up
pylapp Oct 16, 2024
a8162b7
chore: clean up
pylapp Oct 16, 2024
cdffc6c
docs: add details about warnings
pylapp Oct 16, 2024
953ad06
test: update unit tests for color semantic tokens
pylapp Oct 16, 2024
8cae2e3
feat: more tokens, more tests, more doc
pylapp Oct 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,28 @@ Remember _Gitleaks_ is also used in GitHub project side thanks to the [dedicated

We use _SwiftLint_ in this project so as to be sure the source code follows defined guidelines for the syntax and other points.
You must run _SwiftLint_ in CLI or using _Xcode_ to be sure you don't keep and submit warnings.
In most of cases you **must** fiw warnigns, but it could happen some of them should be disabled, mainly for tests cases.
Explain why in yout commtis and pull request comments you choose to disable them.
**In most of cases you must fix warnings, or explain why in your commtis and pull request comments you choose to disable them.**

Today, only in very few cases some SwiftLint warnings are disabled:
- in tests classes
- in files containing tokens which will be generated

The warnings which can be disabled for token files:
- *missing_docs*: because tokens will be generated without documentation by the tokenator
- *identifier_name*: because the name of the tokens are defined in *Figma* and strongly related to the design system
- *line_length*: because tokens definition can take a lot of place
- *file_length*: because the files containing declarations or definitions of tokens can be very long

The warnings which can be disabled for test classes files and mocks files:
- *identifier_name*: because of length of tokens names
- *type_name*: because stringly related to the types under test, which can have a long name
- *line_length*: because of length of tokens names
- *file_length*: because of the amount of tokens to test
- *type_body_length*: because we can have a lot of tests to do
- *required_deinit*: because we do not need to manage init and deinit of test classe
- *implicitly_unwrapped_optional*: because for declaration of themes to test we bang!

Do not forget if possible to enable the warnings in the end of the file to reduce as much as possible the scope of the disabled warnings. Disable warnings only if needed.

## CI/CD

Expand Down
14 changes: 7 additions & 7 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ cyclomatic_complexity:
ignores_case_statements: true

file_length:
warning: 800
error: 1000
warning: 500
error: 800

force_cast:
severity: error

function_body_length:
warning: 50
error: 100
error: 80

function_parameter_count:
warning: 6
Expand All @@ -187,8 +187,8 @@ implicit_getter:

identifier_name:
max_length:
warning: 60
error: 80
warning: 40
error: 50
min_length:
warning: 1
allowed_symbols:
Expand Down Expand Up @@ -230,8 +230,8 @@ type_body_length: 250

type_name:
max_length:
warning: 60
error: 80
warning: 40
error: 50
min_length:
warning: 1
allowed_symbols:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- [Library] Add semantic color tokens ([#124](https://github.com/Orange-OpenSource/ouds-ios/issues/124))
- [DemoApp] Fix some design issues and mutualize some UI elements ([#189](https://github.com/Orange-OpenSource/ouds-ios/issues/189))
- [DemoApp] Add sizing token screen in demo app ([#150](https://github.com/Orange-OpenSource/ouds-ios/issues/150))
- [DemoApp] Add spacing token screen in demo app ([#149](https://github.com/Orange-OpenSource/ouds-ios/issues/149))
Expand All @@ -16,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [Library] Update of semantic color tokens
- [Library/DemoApp] Updates SwiftLint rules, fix linter warnings ([#143](https://github.com/Orange-OpenSource/ouds-ios/issues/143))
- [Tool] Update the templates for GitHub issues
- [Tool] Improve script for documentation generation ([#168](https://github.com/Orange-OpenSource/ouds-ios/issues/168))
Expand All @@ -36,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

- [Library] Remove all color alias semantic tokens and any optional color tokens type uses
- [Library] `SoshTheme` ([#180](https://github.com/Orange-OpenSource/ouds-ios/issues/180))
- [Library] `fontSizeMobile*`, `fontSizeTablet*`, `fontLineHeightMobile*`, `fontLineHeightTablet*`, `fontLetterSpacingMobile*`, `fontLetterSpacingTablet*` removed (update of October 4th)
- [Library] `spaceRowGapWithIconTaller`, `spaceColumnGapWithIconTaller` removed (update of October 7th)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import OUDSTokensRaw
import OUDSTokensSemantic

// TODO: Check if we can get rid of alias colors tokens which are optional
// swiftlint:disable force_unwrapping

/// Defines for `OUDSButton` the basic configuration which can be overriden in subthemes / subclasses of this theme.
/// **Warning: These are random and dumb values**
Expand All @@ -26,17 +25,15 @@ extension OUDSTheme: ButtonsComponentTokens {
@objc open var buttonInternalSpacing: SpacingPaddingInlineSemanticToken { spacePaddingInlineShort }

@objc open var buttonBorderStyle: BorderStyleSemanticToken { borderStyleDefault }
@objc open var buttonBorderColor: ColorSemanticToken { colorBorderDefault! }
@objc open var buttonBorderColor: ColorSemanticToken { colorBorderDefault }
@objc open var buttonBorderWidth: BorderWidthSemanticToken { borderWidthDefault }
@objc open var buttonBorderRadius: BorderRadiusSemanticToken { borderRadiusShort }

@objc open var buttonForegroundColor: ColorSemanticToken { colorContentBrandPrimary! }
@objc open var buttonBackgroundColor: ColorSemanticToken { colorBackgroundBrandPrimary! }
@objc open var buttonForegroundColor: ColorSemanticToken { colorContentBrandPrimary }
@objc open var buttonBackgroundColor: ColorSemanticToken { colorBackgroundBrandPrimary }

@objc open var buttonWidth: SizingSemanticToken { DimensionRawTokens.dimension3000 }
@objc open var buttonHeight: SizingSemanticToken { DimensionRawTokens.dimension1000 }

@objc open var buttonTypography: MultipleTypographyTokens { typeDisplayMedium }
}

// swiftlint:enable force_unwrapping
Loading