-
Notifications
You must be signed in to change notification settings - Fork 8
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
Prefer attributes over CSS classes #738
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rajsite
commented
Sep 21, 2022
mollykreis
approved these changes
Sep 21, 2022
...ojects/ni/nimble-angular/src/directives/breadcrumb/tests/nimble-breadcrumb.directive.spec.ts
Outdated
Show resolved
Hide resolved
...rojects/ni/nimble-angular/src/directives/icon-base/tests/nimble-icon-check.directive.spec.ts
Outdated
Show resolved
Hide resolved
...rojects/ni/nimble-angular/src/directives/icon-base/tests/nimble-icon-check.directive.spec.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: mollykreis <20542556+mollykreis@users.noreply.github.com>
jattasNI
approved these changes
Sep 21, 2022
...rojects/ni/nimble-angular/src/directives/icon-base/tests/nimble-icon-check.directive.spec.ts
Show resolved
Hide resolved
...-workspace/projects/ni/nimble-angular/src/directives/icon-base/nimble-icon-base.directive.ts
Show resolved
Hide resolved
Co-authored-by: Jesse Attas <jattasNI@users.noreply.github.com>
Heads up that the "Testing" section of your PR description is partially missing/ cut off - I only see "For nimble-components largely relied" in it. |
msmithNI
approved these changes
Sep 22, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request
🤨 Rationale
This PR migrates nimble away from using host CSS classes as part of the API for nimble components.
For users, host CSS classes defining styles provides poor typing compared to attributes and is strange as users expect to define classes and associated styles themselves. For nimble developers host classes make inflexible APIs as you cannot readily associate behavior changes to adding or removing classes and even doing so may defy user expectations.
See the discussion in #676 for additional background.
👩💻 Implementation
The following API changes were made per component:
breadcrumb
[appearance]
enum has keys:default
,prominent
.prominent-links
button
[appearance-variant]
enum has keysdefault
,primary
.primary
combobox
[error-visible]
boolean.invalid
icon
[severity]
enum has keysdefault
,success
,information
,warning
,error
.fail
,.warning
,.pass
,.information
number-field
[error-visible]
boolean.invalid
text-field
[full-bleed]
boolean.clear-inline-padding
[error-visible]
boolean.invalid
tooltip
[severity]
enum has keysdefault
,information
,error
.fail
,.information
[icon-visible]
boolean attribute.icon-visible
In addition some minor refactors are included in this PR:
IHasErrorText
renamed toErrorPattern
to match our other pattern conventions and used consistentlyButtonPattern
was also updated to alignDesignSystem.tagFor
used consistently in component templates instead ofcontext.tagFor
or hard-coded names🧪 Testing
For nimble-components largely relied on chromatic and storybook for regressions. For components, angular, and blazor added the expected tests for new enumerated attributes (type tests, directive tests, and blazor component render tests).
✅ Checklist