-
Notifications
You must be signed in to change notification settings - Fork 45
feat: style lint rules - gap, margin, padding #10013
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| { | ||
| "extends": ["../../.stylelintrc.json"], | ||
| "rules": { | ||
| "kolibri/common-component-css-must-be-in-layer": false, | ||
| "kolibri/common-component-css-must-be-in-layer": true, | ||
| "kolibri/component-allowed-layer-names": true, | ||
| "kolibri/theme-allowed-layer-names": true, | ||
| "kolibri/common-no-at-root": false, | ||
|
|
@@ -13,6 +13,11 @@ | |
| "pathPattern": "/packages/components/src/components/", | ||
| "strict": false | ||
| } | ||
| ] | ||
| ], | ||
| "property-disallowed-list": ["gap", "row-gap", "column-gap"], | ||
| "declaration-property-value-allowed-list": { | ||
| "margin": ["0", "auto"], | ||
| "padding": ["0"] | ||
| } | ||
|
Comment on lines
+18
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,9 +30,10 @@ | |||||||||||||
| content: '✓ '; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| /* needed hack for vertical alignment */ | ||||||||||||||
| &[multiple] option { | ||||||||||||||
| padding: calc((var(--a11y-min-size) - to-rem(16)) / 2) 0.5em; | ||||||||||||||
| display: flex; | ||||||||||||||
| align-items: center; | ||||||||||||||
| min-height: var(--a11y-min-size); | ||||||||||||||
|
Comment on lines
+34
to
+36
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Styling native
Suggested change
|
||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,19 +22,21 @@ | |
| } | ||
| } | ||
|
|
||
| &:not([multiple]) &__option { | ||
| padding: 0.5em; | ||
| &[multiple] &__option { | ||
| padding: 0 to-rem(8); | ||
|
|
||
| &::before { | ||
| margin-right: to-rem(8); | ||
| } | ||
| } | ||
|
|
||
| &:not([multiple], [size]) { | ||
| height: to-rem(40); | ||
| } | ||
| } | ||
|
|
||
| .kol-input-container:has(:not(.kol-select[multiple])) { | ||
| .kol-input-container:not(:has(.kol-select[multiple])) { | ||
| position: relative; | ||
| padding: 0; | ||
| gap: 0; | ||
| grid-template-columns: auto max-content min-content; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The removal of |
||
|
|
||
| .kol-input-container__adornment { | ||
|
|
||
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.
Disallowing
gapproperties entirely prevents the use of modern flexbox and grid spacing techniques.gapis often preferred over margins for managing internal spacing between component parts (like icons and labels) because it avoids side effects on the container's edges. A blanket ban might lead to less maintainable code using child margins. Consider allowinggapwhile perhaps restricting its values to theme-approved tokens.