Skip to content

Commit aac8bea

Browse files
committed
FEATURE: Make tab borders cut off
1 parent cb26c1e commit aac8bea

File tree

3 files changed

+48
-65
lines changed

3 files changed

+48
-65
lines changed
Lines changed: 37 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
// @use "../../../../public/Frontend/scss/helpers";
2-
// TODO border, TODO css variables
3-
41
.tabs {
52
position: relative;
63
overflow-x: auto;
@@ -18,7 +15,6 @@
1815
flex-shrink: 0;
1916
padding: 0;
2017
margin: 0;
21-
text-transform: uppercase;
2218
background: none;
2319
appearance: none;
2420
border: none;
@@ -53,6 +49,7 @@
5349

5450
.tabs {
5551
display: flex;
52+
justify-content: center;
5653
padding: 0;
5754
}
5855

@@ -62,6 +59,7 @@
6259

6360
.tabs-content__wrapper {
6461
position: relative;
62+
padding-top: 48px;
6563

6664
&::after {
6765
bottom: -1px;
@@ -79,83 +77,62 @@
7977
display: flex;
8078
flex-direction: column;
8179
gap: 20px;
82-
// @include helpers.neos-borders(0px, 12px);
83-
border: 1px solid #e7e7e8;
8480
padding-left: 15px;
8581
padding-right: 15px;
8682
padding-bottom: 15px;
87-
background: rgba(242, 242, 242, 0.5);
88-
border-top: none;
8983
}
9084

9185
.tab-item:not([hidden]){
9286
display: inline-block;
9387
width: 100%;
9488
}
9589

96-
.tabs .tab {
97-
&:focus,
98-
&:active,
99-
&[aria-selected="true"] {
100-
&:before {
101-
content: "";
102-
width: 18px;
103-
border-top: 1px solid #e7e7e8;
104-
position: absolute;
105-
left: -7px;
106-
transform-origin: right top;
107-
transform: rotateZ(-45deg);
108-
z-index: 1;
109-
}
110-
}
111-
}
90+
.tabs {
91+
.tab {
92+
@include clippedForm;
11293

113-
.tabs .tab {
11494
position: relative;
115-
color: var(--c-brand);
95+
color: $headingsColor;
11696

11797
.tab-link__inner {
118-
pointer-events: none;
119-
display: grid;
120-
121-
border: 1px solid transparent;
122-
border-bottom-color: #e7e7e8;
123-
124-
font-weight: 540;
125-
// @include helpers.neos-borders(12px, 0px);
126-
127-
&:empty::after {
128-
content: "Tab title";
129-
color: #ccc;
130-
}
98+
pointer-events: none;
99+
display: grid;
100+
font-weight: bold;
101+
font-family: $brand-font-family;
102+
103+
&:empty::after {
104+
content: "Tab title";
105+
color: #ccc;
106+
}
131107
}
132108

133109
&[aria-selected="true"] {
134-
.tab-link__inner {
135-
background-color: rgba(242, 242, 242, 0.5);
136-
border: 1px solid #e7e7e8;
137-
border-bottom: none;
138-
}
110+
.tab-link__inner {
111+
background-color: brand('primary');
112+
}
139113

140-
color: var(--c-accent);
114+
color: #fff;
141115
}
142116

143117
&:focus, &:active, &:focus[aria-selected="true"] {
144-
&::before {
145-
border-top-color: var(--c-accent);
146-
}
147-
148-
.tab-link__inner {
149-
background-color: rgba(242, 242, 242, 0.5);
150-
border-left-color: var(--c-accent);
151-
border-right-color: var(--c-accent);
152-
border-top-color: var(--c-accent);
153-
}
118+
.tab-link__inner {
119+
background-color: brand('primary');
120+
}
154121
}
155-
}
156122

157-
.tabs .spacer {
158-
display: flex;
159-
flex-grow: 1;
160-
border-bottom: 1px solid #e7e7e8;
123+
&:focus,
124+
&:active,
125+
&[aria-selected="true"] {
126+
&:before {
127+
content: "";
128+
width: 18px;
129+
border-top: 1px solid #e7e7e8;
130+
position: absolute;
131+
left: -7px;
132+
transform-origin: right top;
133+
transform: rotateZ(-45deg);
134+
z-index: 1;
135+
}
136+
}
137+
}
161138
}

DistributionPackages/Neos.NeosIo/Resources/Private/Scss/Atoms/_Button.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,7 @@ $btn-horizontal-padding: 40px;
8383

8484
@mixin btnClippedBorder() {
8585
.btn__content {
86-
$clip-path: polygon(var(--btn-clip-width) 0px, 0 var(--btn-clip-height), 0 100%, calc(100% - var(--btn-clip-width)) 100%, 100% calc(100% - var(--btn-clip-height)), 100% 0);
87-
88-
// Autoprefixer doesn't add the required webkit prefix for some reason
89-
-webkit-clip-path: #{$clip-path};
90-
clip-path: #{$clip-path};
86+
@include clippedForm;
9187
}
9288
}
9389

DistributionPackages/Neos.NeosIo/Resources/Private/Scss/_Framework/_Mixins.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,13 @@
8787
}
8888
}
8989
}
90+
91+
@mixin clippedForm() {
92+
$btn-clip-width: 14px;
93+
$btn-clip-height: 10px;
94+
$clip-path: polygon($btn-clip-width 0px, 0 $btn-clip-height, 0 100%, calc(100% - #{$btn-clip-width}) 100%, 100% calc(100% - #{$btn-clip-height}), 100% 0);
95+
96+
// Autoprefixer doesn't add the required webkit prefix for some reason
97+
-webkit-clip-path: #{$clip-path};
98+
clip-path: #{$clip-path};
99+
}

0 commit comments

Comments
 (0)