Skip to content

Commit 3f2114a

Browse files
committed
Extract octicons to components
1 parent 4f14592 commit 3f2114a

File tree

2 files changed

+18
-21
lines changed

2 files changed

+18
-21
lines changed
Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,22 @@
11
import * as React from "react";
2+
import { styled } from "styled-components";
3+
4+
const Octicon = styled.svg`
5+
fill: var(--vscode-editor-foreground);
6+
margin-top: 0.25em;
7+
`;
8+
9+
const OcticonLight = styled(Octicon)`
10+
opacity: 0.6;
11+
`;
212

313
/**
414
* These icons come from https://github.com/microsoft/vscode-icons
515
* and are used under the Creative Commons License, see `LICENSE`
616
* file in this directory.
717
*/
818
export const chevronDown = (
9-
<svg
10-
className="octicon"
19+
<Octicon
1120
width="16"
1221
height="16"
1322
viewBox="0 0 16 16"
@@ -19,25 +28,23 @@ export const chevronDown = (
1928
clipRule="evenodd"
2029
d="M7.976 10.072l4.357-4.357.62.618L8.284 11h-.618L3 6.333l.62-.618 4.356 4.357z"
2130
/>
22-
</svg>
31+
</Octicon>
2332
);
2433

2534
export const chevronRight = (
26-
<svg
27-
className="octicon"
35+
<Octicon
2836
width="16"
2937
height="16"
3038
viewBox="0 0 16 16"
3139
fill="none"
3240
xmlns="http://www.w3.org/2000/svg"
3341
>
3442
<path d="M5.7 13.7L5 13l4.6-4.6L5 3.7l.7-.7 5 5v.7l-5 5z" />
35-
</svg>
43+
</Octicon>
3644
);
3745

3846
export const listUnordered = (
39-
<svg
40-
className="octicon octicon-light"
47+
<OcticonLight
4148
width="16"
4249
height="16"
4350
viewBox="0 0 16 16"
@@ -49,12 +56,11 @@ export const listUnordered = (
4956
clipRule="evenodd"
5057
d="M2 3H1v1h1V3zm0 3H1v1h1V6zM1 9h1v1H1V9zm1 3H1v1h1v-1zm2-9h11v1H4V3zm11 3H4v1h11V6zM4 9h11v1H4V9zm11 3H4v1h11v-1z"
5158
/>
52-
</svg>
59+
</OcticonLight>
5360
);
5461

5562
export const info = (
56-
<svg
57-
className="octicon octicon-light"
63+
<OcticonLight
5864
width="16"
5965
height="16"
6066
viewBox="0 0 16 16"
@@ -66,5 +72,5 @@ export const info = (
6672
clipRule="evenodd"
6773
d="M8.568 1.03a6.8 6.8 0 0 1 4.192 2.02 7.06 7.06 0 0 1 .46 9.39 6.85 6.85 0 0 1-8.58 1.74 7 7 0 0 1-3.12-3.5 7.12 7.12 0 0 1-.23-4.71 7 7 0 0 1 2.77-3.79 6.8 6.8 0 0 1 4.508-1.15zm.472 12.85a5.89 5.89 0 0 0 3.41-2.07 6.07 6.07 0 0 0-.4-8.06 5.82 5.82 0 0 0-7.43-.74 6.06 6.06 0 0 0 .5 10.29 5.81 5.81 0 0 0 3.92.58zM8.51 7h-1v4h1V7zm0-2h-1v1h1V5z"
6874
/>
69-
</svg>
75+
</OcticonLight>
7076
);

extensions/ql-vscode/src/view/results/resultsView.css

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,3 @@ td.vscode-codeql__path-index-cell {
144144
.vscode-codeql__location-cell {
145145
text-align: right !important;
146146
}
147-
148-
.octicon {
149-
fill: var(--vscode-editor-foreground);
150-
margin-top: 0.25em;
151-
}
152-
153-
.octicon-light {
154-
opacity: 0.6;
155-
}

0 commit comments

Comments
 (0)