Skip to content

Commit fa6eac6

Browse files
authored
Merge pull request #1399 from nrkno/feat/shelf-tabs-narrower/sofie-3849
feat: shelf tabs are narrower (sofie-3849)
2 parents 608dd27 + 5e64dce commit fa6eac6

File tree

2 files changed

+50
-18
lines changed

2 files changed

+50
-18
lines changed

meteor/client/styles/shelf/shelf.scss

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,33 +128,61 @@
128128
}
129129

130130
.rundown-view__shelf__tabs__tab {
131+
position: relative;
131132
display: block;
132133
background: none;
133134
border: none;
134-
position: relative;
135135
flex: 1 1;
136136
max-width: 7em;
137-
min-width: 13em;
137+
min-width: min-content;
138138
overflow: hidden;
139139
text-overflow: ellipsis;
140140
white-space: nowrap;
141141
text-align: center;
142-
color: #8f8f8f;
143142
line-height: $inspector-shelf-tabs-height;
144143
cursor: pointer;
145144
user-select: none;
145+
padding-inline: 1.5em;
146146

147147
outline-offset: -5px;
148148

149+
// this is a setup that ensures that the min-content is calculated with this font-weight,
150+
// while we display the button with differing font-weights depending on state
151+
font-weight: 500;
152+
color: transparent;
153+
149154
&:hover {
150-
color: #fff;
151-
transition: 0.3s;
155+
// color: #fff;
156+
// transition: 0.3s;
157+
158+
> .rundown-view__shelf__tabs__tab-label {
159+
color: #fff;
160+
transition: 0.3s;
161+
}
162+
}
163+
164+
> .rundown-view__shelf__tabs__tab-label {
165+
position: absolute;
166+
top: 0;
167+
left: 0;
168+
right: 0;
169+
line-height: inherit;
170+
font-weight: 300;
171+
color: #b0b0b0;
152172
}
153173

154174
&.selected {
155-
color: #fff;
156-
font-weight: 500;
157-
text-shadow: 0 0 5px #000;
175+
// color: #fff;
176+
// font-weight: 500;
177+
// text-shadow: 0 0 5px #000;
178+
// transition: 0s;
179+
180+
> .rundown-view__shelf__tabs__tab-label {
181+
color: #fff;
182+
font-weight: 500;
183+
text-shadow: 0 0 5px #000;
184+
transition: 0s;
185+
}
158186

159187
&::after {
160188
content: ' ';

meteor/client/ui/Shelf/ShelfRundownLayout.tsx

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export function ShelfRundownLayout(props: Readonly<IShelfRundownLayoutProps>): J
5252
tabIndex={0}
5353
role="tab"
5454
>
55+
<div className="rundown-view__shelf__tabs__tab-label">{t('AdLib')}</div>
5556
{t('AdLib')}
5657
</button>
5758
<button
@@ -62,6 +63,7 @@ export function ShelfRundownLayout(props: Readonly<IShelfRundownLayoutProps>): J
6263
tabIndex={0}
6364
role="tab"
6465
>
66+
<div className="rundown-view__shelf__tabs__tab-label">{t('Global AdLib')}</div>
6567
{t('Global AdLib')}
6668
</button>
6769
</>
@@ -79,21 +81,23 @@ export function ShelfRundownLayout(props: Readonly<IShelfRundownLayoutProps>): J
7981
tabIndex={0}
8082
role="tab"
8183
>
84+
<div className="rundown-view__shelf__tabs__tab-label">{panel.name}</div>
8285
{panel.name}
8386
</button>
8487
))
8588
)}
89+
<button
90+
className={ClassNames('rundown-view__shelf__tabs__tab', {
91+
selected: (props.selectedTab || SHELF_DEFAULT_TAB) === ShelfTabs.SYSTEM_HOTKEYS,
92+
})}
93+
onClick={() => onSwitchTab(ShelfTabs.SYSTEM_HOTKEYS)}
94+
tabIndex={0}
95+
role="tab"
96+
>
97+
<div className="rundown-view__shelf__tabs__tab-label">{t('Shortcuts')}</div>
98+
{t('Shortcuts')}
99+
</button>
86100
</OverflowingContainer>
87-
<button
88-
className={ClassNames('rundown-view__shelf__tabs__tab', {
89-
selected: (props.selectedTab || SHELF_DEFAULT_TAB) === ShelfTabs.SYSTEM_HOTKEYS,
90-
})}
91-
onClick={() => onSwitchTab(ShelfTabs.SYSTEM_HOTKEYS)}
92-
tabIndex={0}
93-
role="tab"
94-
>
95-
{t('Shortcuts')}
96-
</button>
97101
</div>
98102
<div className="rundown-view__shelf__panel super-dark" role="tabpanel">
99103
{!rundownLayout ? (

0 commit comments

Comments
 (0)