|
6 | 6 | useRef, |
7 | 7 | useState, |
8 | 8 | } from 'react'; |
9 | | -import styled from 'styled-components'; |
10 | 9 |
|
11 | 10 | import { Block } from '../../Block'; |
12 | 11 | import { Action, Button, CubeActionProps } from '../../actions'; |
@@ -55,54 +54,14 @@ const TabsContainerElement = tasty(Flex, { |
55 | 54 | height: 'max 100%', |
56 | 55 | width: 'max 100%', |
57 | 56 | position: 'relative', |
| 57 | + fade: { |
| 58 | + '': false, |
| 59 | + '[data-is-left-fade]': '3x left', |
| 60 | + '[data-is-right-fade]': '3x right', |
| 61 | + }, |
58 | 62 | }, |
59 | 63 | }); |
60 | 64 |
|
61 | | -const StyledTabsContainerElement = styled(TabsContainerElement)` |
62 | | - &::before { |
63 | | - content: ''; |
64 | | - display: block; |
65 | | - opacity: 0; |
66 | | - position: absolute; |
67 | | - top: 0; |
68 | | - left: 0; |
69 | | - pointer-events: none; |
70 | | - width: 32px; |
71 | | - height: 37px; |
72 | | - transition: all 0.15s linear; |
73 | | - background-image: linear-gradient( |
74 | | - to left, |
75 | | - rgba(255, 255, 255, 0), |
76 | | - rgba(255, 255, 255, 1) |
77 | | - ); |
78 | | - z-index: 1; |
79 | | - } |
80 | | -
|
81 | | - &::after { |
82 | | - content: ''; |
83 | | - display: block; |
84 | | - opacity: 0; |
85 | | - position: absolute; |
86 | | - top: 0; |
87 | | - right: 0; |
88 | | - width: 32px; |
89 | | - height: 37px; |
90 | | - pointer-events: none; |
91 | | - transition: all 0.15s linear; |
92 | | - background-image: linear-gradient( |
93 | | - to right, |
94 | | - rgba(255, 255, 255, 0), |
95 | | - rgba(255, 255, 255, 1) |
96 | | - ); |
97 | | - z-index: 1; |
98 | | - } |
99 | | -
|
100 | | - &[data-is-left-fade]::before, |
101 | | - &[data-is-right-fade]::after { |
102 | | - opacity: 1; |
103 | | - } |
104 | | -`; |
105 | | - |
106 | 65 | const DirtyBadge = tasty({ |
107 | 66 | element: 'DirtyBadge', |
108 | 67 | styles: { |
@@ -385,7 +344,7 @@ export function FileTabs({ |
385 | 344 | } |
386 | 345 |
|
387 | 346 | return ( |
388 | | - <StyledTabsContainerElement |
| 347 | + <TabsContainerElement |
389 | 348 | data-is-left-fade={leftFade || null} |
390 | 349 | data-is-right-fade={rightFade || null} |
391 | 350 | {...props} |
@@ -423,7 +382,7 @@ export function FileTabs({ |
423 | 382 | {children} |
424 | 383 | </Flex> |
425 | 384 | </FileTabsContext.Provider> |
426 | | - </StyledTabsContainerElement> |
| 385 | + </TabsContainerElement> |
427 | 386 | ); |
428 | 387 | } |
429 | 388 |
|
|
0 commit comments