Skip to content

Commit 122e46c

Browse files
committed
[REF]: Change icons style location in a sass file. ALso overcome the issue when Mui sets box-sizing=inherit
1 parent fce8e3c commit 122e46c

File tree

6 files changed

+32
-7
lines changed

6 files changed

+32
-7
lines changed

src/files-ui/components/file-card/FileCard.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
}
221221

222222
//// ICONS
223-
.files-ui-file-icon {
223+
/* .files-ui-file-icon {
224224
font-size: 0.7rem;
225225
min-width: 19px;
226226
min-height: 19px;
@@ -229,6 +229,7 @@
229229
border-radius: 50%;
230230
background-color: rgba(32, 33, 36, 0.65);
231231
word-break: break-word;
232+
box-sizing: content-box;
232233
&:hover {
233234
background-color: rgba(32, 33, 36, 0.85);
234235
}
@@ -238,4 +239,4 @@
238239
background-color: rgba(154, 160, 166, 0.85);
239240
}
240241
}
241-
}
242+
} */

src/files-ui/components/file-card/FileCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from "react";
22
import { FileCardProps } from "./FileCardProps";
33
import "./FileCard.scss";
4+
import "./../icons/IconStyles.scss";
45
import "./components/FileCardPaper.scss";
56
import { fileSizeFormater, getLocalFileItemData, handleClickUtil, shrinkWord } from "../../core";
67
import useProgress from "../file-mosaic/hooks/useProgress";

src/files-ui/components/file-mosaic/components/file-mosaic/FileMosaic.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
}
174174

175175
//// ICONS
176-
.files-ui-file-icon {
176+
/* .files-ui-file-icon {
177177
font-size: 0.7rem;
178178
min-width: 19px;
179179
min-height: 19px;
@@ -182,6 +182,7 @@
182182
border-radius: 50%;
183183
background-color: rgba(32, 33, 36, 0.65);
184184
word-break: break-word;
185+
box-sizing: content-box;
185186
&:hover {
186187
background-color: rgba(32, 33, 36, 0.85);
187188
}
@@ -192,3 +193,4 @@
192193
}
193194
}
194195
}
196+
*/

src/files-ui/components/file-mosaic/components/file-mosaic/FileMosaic.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import {
55
getLocalFileItemData,
66
handleClickUtil,
77
} from "../../../../core";
8-
import { FileMosaicProps } from "./FileMosaicProps";
98
import "./FileMosaic.scss";
9+
import "./../../../icons/IconStyles.scss";
10+
import { FileMosaicProps } from "./FileMosaicProps";
1011
import LayerContainer from "../file-mosaic-layer/LayerContainer";
1112
import Layer from "../file-mosaic-layer/Layer";
1213
import FileMosaicName from "../FileMosaicName/FileMosaicName";
@@ -115,7 +116,7 @@ const FileMosaic: React.FC<FileMosaicProps> = (props: FileMosaicProps) => {
115116
);
116117

117118
//The size formatted and rounded in 2 decimals
118-
const sizeFormatted: string| undefined = fileSizeFormater(localSize);
119+
const sizeFormatted: string | undefined = fileSizeFormater(localSize);
119120
//alwaysActive
120121
const [showInfo, setShowInfo] = React.useState<boolean>(false);
121122

src/files-ui/components/icons/Cancel/Cancel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React, { FC } from "react";
1+
import * as React from "react";
22
import { parseSize } from "../utils/utils";
33
import { CancelProps } from "./CancelProps";
44
import { handleClickUtil } from "../../../core";
55

6-
const Cancel: FC<CancelProps> = (props: CancelProps) => {
6+
const Cancel: React.FC<CancelProps> = (props: CancelProps) => {
77
const { size, color, colorFill, onClick, style, className } = props;
88
const finalSize = parseSize(size);
99
const finalStyle = style ? style : {};
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.files-ui-file-icon {
2+
font-size: 0.7rem;
3+
min-width: 19px;
4+
min-height: 19px;
5+
margin: 0;
6+
padding: 2px 2px;
7+
border-radius: 50%;
8+
background-color: rgba(32, 33, 36, 0.65);
9+
word-break: break-word;
10+
box-sizing: content-box;
11+
&:hover {
12+
background-color: rgba(32, 33, 36, 0.85);
13+
}
14+
&.dark-mode {
15+
background-color: rgba(154, 160, 166, 0.65);
16+
&:hover {
17+
background-color: rgba(154, 160, 166, 0.85);
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)