Skip to content

Commit b2386d8

Browse files
authored
Merge pull request #732 from plotly/traceselector-styling
Traceselector styling
2 parents 80368bb + d063676 commit b2386d8

File tree

3 files changed

+105
-14
lines changed

3 files changed

+105
-14
lines changed

scripts/postcss.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const internetExplorerPostCSS = () => {
2727
combineSelectors,
2828
customProperties,
2929
removeRoot,
30-
autoprefixer({browsers: ['ie 11']}),
30+
autoprefixer({browsers: ['ie 11'], grid: true}),
3131
cssnano,
3232
];
3333
fs.readFile(`${BUILD_ENV}/${fileName}.ie.css`, (err, css) => {
@@ -37,16 +37,12 @@ const internetExplorerPostCSS = () => {
3737
to: `${BUILD_ENV}/${fileName}.ie.min.css`,
3838
})
3939
.then(result => {
40-
fs.writeFile(
41-
`${BUILD_ENV}/${fileName}.ie.min.css`,
42-
result.css,
43-
error => {
44-
if (error) {
45-
/* eslint-disable no-console */
46-
console.log(error);
47-
}
40+
fs.writeFile(`${BUILD_ENV}/${fileName}.ie.min.css`, result.css, error => {
41+
if (error) {
42+
/* eslint-disable no-console */
43+
console.log(error);
4844
}
49-
);
45+
});
5046
});
5147
});
5248
};

src/styles/components/sidebar/_main.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
text-align: center;
88
background: var(--sidebar-background);
99
overflow-y: auto;
10+
overflow-x: hidden;
1011
float: left;
1112
border-right: var(--border-default);
1213
flex-grow: 1;
1314
@include scrollbar(0px);
15+
-ms-overflow-style: none;
1416

1517
&__group {
1618
background-color: var(--sidebar-group-background-base);

src/styles/components/widgets/_trace-type-selector.scss

Lines changed: 97 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,52 @@ $image-size: 60px;
1616
flex-shrink: 0;
1717
flex-grow: 0;
1818

19+
&:nth-of-type(4n + 3) {
20+
-ms-grid-column: 1;
21+
}
22+
&:nth-of-type(4n) {
23+
-ms-grid-column: 2;
24+
}
25+
&:nth-of-type(4n + 1) {
26+
-ms-grid-column: 3;
27+
}
28+
&:nth-of-type(4n + 2) {
29+
-ms-grid-column: 4;
30+
}
31+
&:nth-of-type(3),
32+
&:nth-of-type(4),
33+
&:nth-of-type(5),
34+
&:nth-of-type(6) {
35+
-ms-grid-row: 2;
36+
}
37+
&:nth-of-type(7),
38+
&:nth-of-type(8),
39+
&:nth-of-type(9),
40+
&:nth-of-type(10) {
41+
-ms-grid-row: 3;
42+
}
43+
44+
.trace-item {
45+
&:nth-of-type(2n + 1) {
46+
-ms-grid-column: 1;
47+
}
48+
&:nth-of-type(2n + 2) {
49+
-ms-grid-column: 2;
50+
}
51+
&:nth-of-type(3),
52+
&:nth-of-type(4) {
53+
-ms-grid-row: 2;
54+
}
55+
&:nth-of-type(5),
56+
&:nth-of-type(6) {
57+
-ms-grid-row: 3;
58+
}
59+
&:nth-of-type(7),
60+
&:nth-of-type(8) {
61+
-ms-grid-row: 4;
62+
}
63+
}
64+
1965
&:not(:first-of-type) {
2066
position: relative;
2167
&::before {
@@ -37,6 +83,53 @@ $image-size: 60px;
3783
&--double {
3884
grid-column: span 2;
3985
flex-grow: 0;
86+
87+
&:nth-of-type(2n + 1) {
88+
-ms-grid-column: 1;
89+
}
90+
&:nth-of-type(2n + 2) {
91+
-ms-grid-column: 3;
92+
}
93+
&:nth-of-type(5),
94+
&:nth-of-type(6) {
95+
-ms-grid-row: 2;
96+
}
97+
&:nth-of-type(7),
98+
&:nth-of-type(8) {
99+
-ms-grid-row: 3;
100+
}
101+
102+
.trace-item {
103+
&:nth-of-type(4n + 1) {
104+
-ms-grid-column: 1;
105+
}
106+
&:nth-of-type(4n + 2) {
107+
-ms-grid-column: 2;
108+
}
109+
&:nth-of-type(4n + 3) {
110+
-ms-grid-column: 3;
111+
}
112+
&:nth-of-type(4n) {
113+
-ms-grid-column: 4;
114+
}
115+
&:nth-of-type(3),
116+
&:nth-of-type(4) {
117+
-ms-grid-row: 1;
118+
}
119+
&:nth-of-type(5),
120+
&:nth-of-type(6),
121+
&:nth-of-type(7),
122+
&:nth-of-type(8) {
123+
-ms-grid-row: 2;
124+
}
125+
&:nth-of-type(9),
126+
&:nth-of-type(10),
127+
&:nth-of-type(11),
128+
&:nth-of-type(12) {
129+
-ms-grid-row: 3;
130+
}
131+
}
132+
40133
.trace-grid__column__items {
41134
display: grid;
42135
grid-gap: 0;
@@ -50,7 +143,7 @@ $image-size: 60px;
50143
grid-template-columns: repeat(2, $item-size);
51144
flex-grow: 1;
52145
width: 100%;
53-
padding: 0 var(--spacing-half-unit) var(--spacing-base-unit);
146+
padding: 0 var(--spacing-half-unit) var(--spacing-half-unit);
54147
}
55148

56149
&__header {
@@ -63,7 +156,7 @@ $image-size: 60px;
63156
justify-content: flex-start;
64157
border-top: var(--border-light);
65158
width: 100%;
66-
padding: var(--spacing-base-unit) var(--spacing-base-unit) 0;
159+
padding: var(--spacing-half-unit) var(--spacing-base-unit) 0;
67160
box-sizing: border-box;
68161
}
69162
}
@@ -76,7 +169,7 @@ $image-size: 60px;
76169
align-items: center;
77170
justify-content: flex-start;
78171
flex-grow: 0;
79-
margin-top: var(--spacing-base-unit);
172+
margin-top: var(--spacing-half-unit);
80173
color: var(--color-text-base);
81174
@include trans;
82175
position: relative;
@@ -175,7 +268,7 @@ $image-size: 60px;
175268
font-weight: var(--font-weight-semibold);
176269
width: $item-size * 0.8;
177270
height: 34px;
178-
margin-top: var(--spacing-half-unit);
271+
margin-top: var(--spacing-quarter-unit);
179272
color: var(--color-text-base);
180273
text-transform: capitalize;
181274
font-size: var(--font-size-small);

0 commit comments

Comments
 (0)