PluginProbe
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News / 4.0.7
Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News v4.0.7
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 4.0.2 4.0.1 2.3.5 2.3.6 2.4.0 2.4.1 2.4.10 2.4.11 2.4.12 2.4.13 2.4.14 2.4.15 2.4.16 2.4.17 2.4.18 2.4.19 2.4.2 2.4.20 2.4.21 All 88 releases
post-carousel / src / components / typography2 / utility.js

utility.js in Smart Post – Post Grid, Post Carousel, Post Slider Gutenberg Blocks for Blog & News 4.0.7, at src/components/typography2/utility.js

69 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { DecorationLineThrough, DecorationUnderline, ItalicIcon } from "./svgIcon";
2
3 export const fontWeightMap = {
4 100: "Thin 100",
5 200: "Extra Light 200",
6 300: "Light 300",
7 400: "Regular 400",
8 500: "Medium 500",
9 600: "Semi Bold 600",
10 700: "Bold 700",
11 800: "Extra Bold 800",
12 900: "Black 900",
13 "100italic": "italic 100",
14 "200italic": "italic 200",
15 "300italic": "italic 300",
16 italic: "italic 400",
17 "400italic": "italic 400",
18 "500italic": "italic 500",
19 "600italic": "italic 600",
20 "700italic": "italic 700",
21 "800italic": "italic 800",
22 "900italic": "italic 900",
23 };
24
25 export const textStylesOptions = [
26 {
27 label: <ItalicIcon />,
28 key: "style",
29 value: "italic",
30 },
31 {
32 label: <DecorationUnderline />,
33 key: "decoration",
34 value: "underline",
35 },
36 {
37 label: <DecorationLineThrough />,
38 key: "decoration",
39 value: "line-through",
40 },
41 {
42 label: "AB",
43 key: "transform",
44 value: "uppercase",
45 },
46 {
47 label: "ab",
48 key: "transform",
49 value: "lowercase",
50 },
51 {
52 label: "Ab",
53 key: "transform",
54 value: "capitalize",
55 },
56 ];
57 export const getFontWeightList = (activeFontFamily) => {
58 const weightLists = activeFontFamily?.font?.variants
59 ?.map((variant) => {
60 const value = variant === "regular" ? "400" : variant;
61 if (fontWeightMap[value]) {
62 return { label: fontWeightMap[value], value: value };
63 }
64 return null;
65 })
66 .filter(Boolean);
67 return weightLists;
68 };
69