Skip to content

feat: style lint rules - gap, margin, padding#10013

Draft
BF150 wants to merge 3 commits intodevelopfrom
feature/9911-style-lint-rules
Draft

feat: style lint rules - gap, margin, padding#10013
BF150 wants to merge 3 commits intodevelopfrom
feature/9911-style-lint-rules

Conversation

@BF150
Copy link
Copy Markdown
Contributor

@BF150 BF150 commented Apr 17, 2026

No description provided.

@BF150 BF150 self-assigned this Apr 17, 2026
@BF150 BF150 changed the title feature: style lint rules - gap, margin, padding feat: style lint rules - gap, margin, padding Apr 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚀 MCP preview deployed to Vercel: https://kolibri-n6yvibkjf-public-ui-kolibri-mcp.vercel.app

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enforces stricter CSS linting rules, including mandatory CSS layers and restrictions on gap, margin, and padding properties. It also refactors select component styles and adjusts input container selectors. Feedback points out that using flexbox on native option elements is poorly supported and suggests longhand padding as an alternative. Additionally, reviewers expressed concerns about the total ban on gap properties, the bypassability of shorthand restrictions via longhand properties, and potential layout regressions caused by removing property resets in the default theme.

Comment on lines +34 to +36
display: flex;
align-items: center;
min-height: var(--a11y-min-size);
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;

}
]
],
"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.

Comment on lines +18 to +21
"declaration-property-value-allowed-list": {
"margin": ["0", "auto"],
"padding": ["0"]
}
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.

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.

@github-actions
Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant