Skip to content

Commit b111ad0

Browse files
Fix/correct margin for bar titles (#4383)
* fix(visualization):spacing in ribbon bar tittle * fix(visualization):remove horizontal scrolling bar fronm the coor metric settings --------- Co-authored-by: Christian Hühn <161825497+ChristianHuehn@users.noreply.github.com>
1 parent 4ff4f66 commit b111ad0

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed

plans/fix-bar-title-margins.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Fix ribbon bar panel title margins
3+
issue: #4287
4+
state: complete
5+
version: N/A
6+
---
7+
8+
## Goal
9+
10+
Fix the margin issue for ribbon bar panel titles where Tailwind CSS reset is overriding the SCSS-defined margin of `0 5px`. Replace SCSS margin with Tailwind utility classes to ensure proper spacing.
11+
12+
## Tasks
13+
14+
### 1. Update ribbon bar panel title styling
15+
- Replace SCSS margin definition with Tailwind utility classes in the HTML template
16+
- The `.section-title` class currently has `margin: 0 5px` defined in SCSS (ribbonBarPanel.component.scss:29)
17+
- Apply `mx-[5px]` Tailwind class directly to the title div element in ribbonBarPanel.component.html:14
18+
- Remove the margin definition from SCSS file since Tailwind classes will handle spacing
19+
20+
### 2. Verify the fix
21+
- Test the visual appearance matches the expected behavior shown in issue screenshots
22+
- Ensure margins are properly applied on both sides of the title text
23+
- Check that the fix works consistently across different ribbon bar panels
24+
25+
## Steps
26+
27+
- [x] Complete Task 1: Add Tailwind margin classes to section-title div in HTML template
28+
- [x] Complete Task 2: Remove SCSS margin definition from ribbonBarPanel.component.scss
29+
- [x] Complete Task 3: Verify the visual appearance matches expected behavior
30+
31+
## Review Feedback Addressed
32+
33+
(To be filled during PR review)
34+
35+
## Notes
36+
37+
- Using `mx-[5px]` Tailwind class which translates to `margin-left: 5px; margin-right: 5px`
38+
- This aligns with the project's migration to DaisyUI and Tailwind CSS
39+
- The my-0 class is implicit as Tailwind reset sets vertical margin to 0 by default

visualization/app/codeCharta/ui/ribbonBar/colorSettingsPanel/colorSettingsPanel.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
[values]="(sliderValues$ | async).values"
3131
[isAttributeDirectionInverted]="isAttributeDescriptionInversed$ | async"
3232
></cc-metric-color-range-diagram>
33-
<label class="form-control gradient-mode-selector">
33+
<label class="form-control my-[5px]">
3434
<div class="label">
3535
<span class="label-text">Gradient Mode</span>
3636
</div>

visualization/app/codeCharta/ui/ribbonBar/colorSettingsPanel/colorSettingsPanel.component.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
.gradient-mode-selector {
2-
margin: 5px 10px;
3-
width: 93%;
4-
}
5-
61
.color-row {
72
display: flex;
83
align-items: center;

visualization/app/codeCharta/ui/ribbonBar/ribbonBarPanel/ribbonBarPanel.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212

1313
@if (title || hasSettings) {
14-
<div #toggle class="section-title" (click)="toggleSettings()">
14+
<div #toggle class="section-title mx-[5px]" (click)="toggleSettings()">
1515
{{ title }}
1616

1717
@if (hasSettings) {

visualization/app/codeCharta/ui/ribbonBar/ribbonBarPanel/ribbonBarPanel.component.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ mat-card {
2626
transition: background-color 0.4s;
2727
border-bottom: 1px solid transparent;
2828
white-space: nowrap;
29-
margin: 0 5px;
3029

3130
@at-root :host.separator & {
3231
border-top: 1px solid rgba(0, 0, 0, 0.12);

0 commit comments

Comments
 (0)