-
Notifications
You must be signed in to change notification settings - Fork 30
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
Refactor Button Component with New Variants and Props #772
base: main
Are you sure you want to change the base?
Conversation
bf061fe
to
bace0b6
Compare
min-width: 10rem; | ||
padding: 0.8rem 1.2rem; | ||
border: 0; | ||
--button-padding-h: #{common.px-to-rem(16)}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: je me demande si utiliser ces mixins c'est malin si on se dit qu'a terme on vire sass ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
effectivement c'est une question à débattre, sass or not sass, perso je serais d'avis, au moins dans un premier temps faire en sorte que sass ne soit pas require pour les consommateur de la lib.
après à voir si tous ce que l'on peux faire en sass est possible en css, certaine mixins peuvent surement être remplacer par des class utilitaires, mais je reste je sais pas trop.
6b3538d
to
16d1064
Compare
16d1064
to
482485e
Compare
) => ( | ||
<button | ||
type="button" | ||
className={classNames( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 pour virer le classModifier
je ne suis pas fan de cette notion de classModifier alors que le className fait déjà très bien le travail et évite de devoir aller voir la doc pour savoir comment surcharger le css d'un composant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C'est l'objectif principale de la v2 de slash.
BREAKING CHANGE: **button**, removed universes variant; use custom class if needed BREAKING CHANGE: **button**, removed hasIconLeft/hasIconRight; CSS auto-detects use of SVG or glyphicon BREAKING CHANGE: **button**, variant reverse is now renamed to secondary BREAKING CHANGE: **button**, variant success is now renamed to validated BREAKING CHANGE: **button**, removed disabled variant; now use button's disabled prop BREAKING CHANGE: **button**, removed circle variant
…on button component BREAKING CHANGE: **button**, prop `className` no longer removes default style BREAKING CHANGE: **button**, prop `classModifier` is removed; use props `variant`, `size`, `leftIcon`, and `rightIcon` instead
482485e
to
e4d1851
Compare
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
Lorsqu'il y a des breaking change impliqué par une PR, il faudrait que cette PR mette à jour tout de suite le guide de Migration, ca évitera de le faire au dernier moment avant la livraison de la nouvelle version. Je vois qu'ici il n'y a que le guide de migration depuis le premier toolkit. Le MIGRATION.md peut être initialisé grâce à cette PR. |
Yes pas faux j'ai complément zapper le guide de migration, je le fais des que possible |
Description:
This PR introduces significant changes to the button component, including a restyle with the new-look Slash DS and the introduction of variant props instead of classModifier. The following breaking changes are included:
Breaking Changes:
Restyle Button with New-Look Slash DS
universes
variant; use custom class if needed.hasIconLeft
/hasIconRight
; CSS now auto-detects use of SVG or glyphicon.reverse
variant tosecondary
.success
variant tovalidated
.disabled
variant; now use button'sdisabled
prop.circle
variant.Introduction of Variant Props
className
no longer removes default style.classModifier
; use propsvariant
,size
,leftIcon
, andrightIcon
instead.Additional Information:
For the CSS part, I have introduced the use of CSS variables for colors, fonts, etc., as well as mixins to provide various shortcuts for creating our CSS classes. All these modifications are open to discussion and may lead to the drafting of an ADR on CSS best practices.
Screanshot: