Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions packages/components/.stylelintrc.json
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,
Expand All @@ -13,6 +13,11 @@
"pathPattern": "/packages/components/src/components/",
"strict": false
}
]
],
"property-disallowed-list": ["gap", "row-gap", "column-gap"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Disallowing gap properties entirely prevents the use of modern flexbox and grid spacing techniques. gap is 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 allowing gap while perhaps restricting its values to theme-approved tokens.

"declaration-property-value-allowed-list": {
"margin": ["0", "auto"],
"padding": ["0"]
}
Comment on lines +18 to +21
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The declaration-property-value-allowed-list for margin and padding only restricts the shorthand properties. This policy is easily bypassed by using longhand properties like margin-top or padding-left. If the intent is to enforce a strict "no-internal-spacing" architecture for components, these longhand properties should also be added to the property-disallowed-list to ensure the rule is effective and consistent.

}
}
5 changes: 3 additions & 2 deletions packages/components/src/components/@shared/_select.mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Styling native <option> elements with display: flex and min-height is generally not supported by major browsers (e.g., Chrome, Safari) as they ignore most layout properties on native options. This change will likely break the vertical alignment that the previous padding-based approach provided. To maintain compatibility while adhering to the new lint rule that restricts the padding shorthand, consider using longhand padding properties.

Suggested change
display: flex;
align-items: center;
min-height: var(--a11y-min-size);
padding-top: calc((var(--a11y-min-size) - to-rem(16)) / 2);
padding-bottom: calc((var(--a11y-min-size) - to-rem(16)) / 2);
padding-inline: 0.5em;

}
}
}
4 changes: 2 additions & 2 deletions packages/components/src/components/dialog/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
@use '../@shared/mixins' as *;
@use '../tooltip/style.scss' as *;

@include kol-card;

@layer kol-component {
@include kol-card;

.kol-dialog,
.kol-modal {
min-height: var(--a11y-min-size);
Expand Down
12 changes: 7 additions & 5 deletions packages/themes/default/src/mixins/select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The removal of padding: 0; and gap: 0; from .kol-input-container may cause layout regressions if these properties are inherited from base styles. Given that the Kern theme still explicitly sets these resets, this change introduces an inconsistency between themes that could lead to visual bugs in the default theme.


.kol-input-container__adornment {
Expand Down
8 changes: 8 additions & 0 deletions packages/themes/kern/src/mixins/_select.mixin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@
background-color: rgb(from var(--kern-color-action-default) r g b / var(--kern-color-action-state-opacity-active));
}
}

&[multiple] &__option {
padding: 0 to-rem(8);

&::before {
margin-right: to-rem(8);
}
}
}

.kol-form-field {
Expand Down
Loading