Skip to content

feat: docs - code style and conventions #10011

Draft
BF150 wants to merge 2 commits intodevelopfrom
feature/9767-code-style-and-conventions-in-docs
Draft

feat: docs - code style and conventions #10011
BF150 wants to merge 2 commits intodevelopfrom
feature/9767-code-style-and-conventions-in-docs

Conversation

@BF150
Copy link
Copy Markdown
Contributor

@BF150 BF150 commented Apr 16, 2026

No description provided.

@BF150 BF150 self-assigned this Apr 16, 2026
@BF150 BF150 linked an issue Apr 16, 2026 that may be closed by this pull request
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 introduces a comprehensive CSS style guide and convention document for the KoliBri project, detailing component structure, theme layers, unit usage, and BEM naming patterns. The review feedback identifies several typos and grammatical errors, suggests clearer terminology for component relationships, and recommends adopting modern Sass best practices by using @use instead of @import.


- every component has a style.scss with its basic definitions
- component styles have to be wrapped in `@layer kol-component`
- styles.scss is importet in its corresponding shadow.tsx
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

Typo: "importet" should be "imported".

Suggested change
- styles.scss is importet in its corresponding shadow.tsx
- styles.scss is imported in its corresponding shadow.tsx

- styles.scss is importet in its corresponding shadow.tsx
- components that are part of other components have their styles in the @shared folder
- here no layer is used, just plain `@mixin componentName`
- in this cases the component file (e.g. alert/style.scss) just includes the mixin (e.g. \_alert.scss)
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

Grammar: "in this cases" should be "in these cases".

Suggested change
- in this cases the component file (e.g. alert/style.scss) just includes the mixin (e.g. \_alert.scss)
- in these cases the component file (e.g. alert/style.scss) just includes the mixin (e.g. \_alert.scss)

- components that are part of other components have their styles in the @shared folder
- here no layer is used, just plain `@mixin componentName`
- in this cases the component file (e.g. alert/style.scss) just includes the mixin (e.g. \_alert.scss)
- every component has to `@include` the styles of every containing component (e.g. icon has to be included in buttons, paging, etc.)
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

Clarity: "containing component" usually refers to the parent component. In this context, it seems to mean the components used within (like icons in buttons). "Component it contains" or "contained component" would be clearer.

Suggested change
- every component has to `@include` the styles of every containing component (e.g. icon has to be included in buttons, paging, etc.)
- every component has to include the styles of every component it contains (e.g. icon has to be included in buttons, paging, etc.)

- all styles are imported in /src/components/index.ts
- components that are part of other components have their styles in the @shared folder
- here no layer is used, just plain `@mixin componentName`
- in this cases the component file (e.g. alert.scss) just includes the mixin (e.g. \_alert.scss)
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

Grammar: "in this cases" should be "in these cases".

Suggested change
- in this cases the component file (e.g. alert.scss) just includes the mixin (e.g. \_alert.scss)
- in these cases the component file (e.g. alert.scss) just includes the mixin (e.g. \_alert.scss)

- components that are part of other components have their styles in the @shared folder
- here no layer is used, just plain `@mixin componentName`
- in this cases the component file (e.g. alert.scss) just includes the mixin (e.g. \_alert.scss)
- every component has to @include the styles of every containing component (e.g. icon has to be included in buttons, paging, etc.)
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

Clarity: "containing component" should be "component it contains". Also, consider wrapping @include in backticks for consistency with the Components section.

Suggested change
- every component has to @include the styles of every containing component (e.g. icon has to be included in buttons, paging, etc.)
- every component has to include the styles of every component it contains (e.g. icon has to be included in buttons, paging, etc.)

When defining `rem` values within KoliBri, always use the provided Sass function:

```
@import '@shared/mixins';
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

Modern Sass (Dart Sass) recommends using @use instead of @import for better module management and to avoid global namespace pollution. Since the project uses @use in other SCSS files, the documentation should reflect this best practice.

Suggested change
@import '@shared/mixins';
@use '@shared/mixins' as *;

}
```

When you need to combine modifiers, please us CSS properties.
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

Typo: "us" should be "use".

Suggested change
When you need to combine modifiers, please us CSS properties.
When you need to combine modifiers, please use CSS properties.

```

When you need to combine modifiers, please us CSS properties.
In the following example, we wan't a different styling for the _Close-Button-Element_ when the component itself has the _card_-Modifier:
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

Typo: "wan't" should be "want".

Suggested change
In the following example, we wan't a different styling for the _Close-Button-Element_ when the component itself has the _card_-Modifier:
In the following example, we want a different styling for the _Close-Button-Element_ when the component itself has the _card_-Modifier:

}
```

Avoid - @root to combine selectors:
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

Technical typo: The Sass directive is @at-root, not @root.

Suggested change
Avoid - @root to combine selectors:
Avoid - @at-root to combine selectors:

@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.

componenten Styles: Liste welche Eigenschaften nicht erlaubt sind

1 participant