@ugurdemirel/landcraft 0.1.4 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/styles.css +12 -0
- package/package.json +14 -7
- package/src/components/Badge.tsx +0 -68
- package/src/components/Blog/BlogCard.tsx +0 -12
- package/src/components/Blog/BlogSection.tsx +0 -95
- package/src/components/Blog/index.ts +0 -8
- package/src/components/Blog/parts.tsx +0 -38
- package/src/components/Blog/types.ts +0 -42
- package/src/components/Blog/variants/Card.tsx +0 -62
- package/src/components/Blog/variants/Row.tsx +0 -41
- package/src/components/Button.tsx +0 -113
- package/src/components/CTA/CTA.tsx +0 -12
- package/src/components/CTA/index.ts +0 -2
- package/src/components/CTA/parts.tsx +0 -26
- package/src/components/CTA/types.ts +0 -12
- package/src/components/CTA/variants/Inverse.tsx +0 -50
- package/src/components/CTA/variants/Panel.tsx +0 -60
- package/src/components/CTA/variants/Surface.tsx +0 -34
- package/src/components/Card.tsx +0 -80
- package/src/components/Container.tsx +0 -86
- package/src/components/FAQ/FAQ.tsx +0 -48
- package/src/components/FAQ/index.ts +0 -2
- package/src/components/FAQ/parts.tsx +0 -74
- package/src/components/FAQ/types.ts +0 -18
- package/src/components/FAQ/variants/Accordion.tsx +0 -46
- package/src/components/FAQ/variants/Cards.tsx +0 -40
- package/src/components/FAQ/variants/Split.tsx +0 -44
- package/src/components/Features/FeatureCard.tsx +0 -44
- package/src/components/Features/FeatureGrid.tsx +0 -14
- package/src/components/Features/index.ts +0 -3
- package/src/components/Features/parts.ts +0 -15
- package/src/components/Features/types.ts +0 -25
- package/src/components/Features/variants/Bento.tsx +0 -32
- package/src/components/Features/variants/Columns.tsx +0 -21
- package/src/components/Features/variants/EditorialRows.tsx +0 -38
- package/src/components/Footer/Footer.tsx +0 -11
- package/src/components/Footer/index.ts +0 -2
- package/src/components/Footer/parts.tsx +0 -101
- package/src/components/Footer/types.ts +0 -32
- package/src/components/Footer/variants/Classic.tsx +0 -59
- package/src/components/Footer/variants/Editorial.tsx +0 -47
- package/src/components/Footer/variants/Minimal.tsx +0 -33
- package/src/components/Hero/Hero.tsx +0 -12
- package/src/components/Hero/index.ts +0 -2
- package/src/components/Hero/parts.tsx +0 -29
- package/src/components/Hero/types.ts +0 -20
- package/src/components/Hero/variants/Centered.tsx +0 -54
- package/src/components/Hero/variants/Split.tsx +0 -53
- package/src/components/Hero/variants/Statement.tsx +0 -60
- package/src/components/LanguageSwitcher/LanguageSwitcher.tsx +0 -37
- package/src/components/LanguageSwitcher/index.ts +0 -6
- package/src/components/LanguageSwitcher/parts.tsx +0 -144
- package/src/components/LanguageSwitcher/types.ts +0 -40
- package/src/components/LanguageSwitcher/useLanguageSwitcher.ts +0 -23
- package/src/components/LanguageSwitcher/variants/Dropdown.tsx +0 -88
- package/src/components/LanguageSwitcher/variants/Modal.tsx +0 -56
- package/src/components/LogoCloud/LogoCloud.tsx +0 -14
- package/src/components/LogoCloud/index.ts +0 -2
- package/src/components/LogoCloud/parts.tsx +0 -32
- package/src/components/LogoCloud/types.ts +0 -16
- package/src/components/LogoCloud/variants/Marquee.tsx +0 -30
- package/src/components/LogoCloud/variants/Quiet.tsx +0 -26
- package/src/components/LogoCloud/variants/Strip.tsx +0 -25
- package/src/components/MegaMenu/MegaMenu.tsx +0 -454
- package/src/components/MegaMenu/index.ts +0 -9
- package/src/components/MegaMenu/types.ts +0 -56
- package/src/components/Modal.tsx +0 -125
- package/src/components/Navbar/Navbar.tsx +0 -185
- package/src/components/Navbar/index.ts +0 -2
- package/src/components/Navbar/types.ts +0 -30
- package/src/components/Newsletter/Newsletter.tsx +0 -12
- package/src/components/Newsletter/index.ts +0 -2
- package/src/components/Newsletter/parts.tsx +0 -23
- package/src/components/Newsletter/types.ts +0 -12
- package/src/components/Newsletter/useNewsletterForm.ts +0 -27
- package/src/components/Newsletter/variants/Card.tsx +0 -62
- package/src/components/Newsletter/variants/Inline.tsx +0 -54
- package/src/components/Newsletter/variants/Underline.tsx +0 -52
- package/src/components/Pricing/Pricing.tsx +0 -37
- package/src/components/Pricing/index.ts +0 -2
- package/src/components/Pricing/parts.tsx +0 -132
- package/src/components/Pricing/types.ts +0 -28
- package/src/components/Pricing/variants/Bento.tsx +0 -72
- package/src/components/Pricing/variants/Cards.tsx +0 -79
- package/src/components/Pricing/variants/Compact.tsx +0 -69
- package/src/components/Prose.tsx +0 -55
- package/src/components/Section.tsx +0 -106
- package/src/components/Slot.tsx +0 -78
- package/src/components/Stats/Stats.tsx +0 -16
- package/src/components/Stats/index.ts +0 -2
- package/src/components/Stats/parts.tsx +0 -29
- package/src/components/Stats/types.ts +0 -23
- package/src/components/Stats/variants/Cells.tsx +0 -34
- package/src/components/Stats/variants/Editorial.tsx +0 -41
- package/src/components/Stats/variants/Hairline.tsx +0 -31
- package/src/components/Stats/variants/Ticker.tsx +0 -36
- package/src/components/Testimonials/TestimonialCard.tsx +0 -61
- package/src/components/Testimonials/Testimonials.tsx +0 -14
- package/src/components/Testimonials/index.ts +0 -3
- package/src/components/Testimonials/parts.ts +0 -7
- package/src/components/Testimonials/types.ts +0 -24
- package/src/components/Testimonials/variants/Carousel.tsx +0 -94
- package/src/components/Testimonials/variants/Grid.tsx +0 -19
- package/src/components/Testimonials/variants/Marquee.tsx +0 -28
- package/src/icons.tsx +0 -290
- package/src/index.ts +0 -120
- package/src/styles/index.css +0 -18
- package/src/utils/cn.ts +0 -6
- package/src/utils/contrast.ts +0 -107
- package/src/utils/iso2Flag.ts +0 -26
- package/src/utils/useTokenForeground.ts +0 -39
- /package/{src/styles → dist}/theme.css +0 -0
package/src/index.ts
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from "./components/Button";
|
|
2
|
-
export { Slot, type SlotProps } from "./components/Slot";
|
|
3
|
-
export { Badge, type BadgeProps, type BadgeVariant, type BadgeSize } from "./components/Badge";
|
|
4
|
-
export {
|
|
5
|
-
Card,
|
|
6
|
-
CardHeader,
|
|
7
|
-
CardTitle,
|
|
8
|
-
CardDescription,
|
|
9
|
-
CardContent,
|
|
10
|
-
CardFooter,
|
|
11
|
-
type CardProps,
|
|
12
|
-
type CardHeaderProps,
|
|
13
|
-
type CardVariant,
|
|
14
|
-
} from "./components/Card";
|
|
15
|
-
export {
|
|
16
|
-
Section,
|
|
17
|
-
SectionHeader,
|
|
18
|
-
type SectionProps,
|
|
19
|
-
type SectionHeaderProps,
|
|
20
|
-
type EyebrowStyle,
|
|
21
|
-
} from "./components/Section";
|
|
22
|
-
export { Hero, type HeroProps, type HeroMeta } from "./components/Hero";
|
|
23
|
-
export { Navbar, type NavbarProps, type NavLink } from "./components/Navbar";
|
|
24
|
-
export {
|
|
25
|
-
MegaMenu,
|
|
26
|
-
type MegaMenuProps,
|
|
27
|
-
type MegaMenuItem,
|
|
28
|
-
type MegaMenuColumn,
|
|
29
|
-
type MegaMenuLink,
|
|
30
|
-
type MegaMenuFeatured,
|
|
31
|
-
} from "./components/MegaMenu";
|
|
32
|
-
export { LogoCloud, type LogoCloudProps, type LogoItem } from "./components/LogoCloud";
|
|
33
|
-
export {
|
|
34
|
-
FeatureCard,
|
|
35
|
-
FeatureGrid,
|
|
36
|
-
type FeatureCardProps,
|
|
37
|
-
type FeatureGridProps,
|
|
38
|
-
type FeatureItem,
|
|
39
|
-
} from "./components/Features";
|
|
40
|
-
export { Stats, type StatsProps, type Stat } from "./components/Stats";
|
|
41
|
-
export { Pricing, type PricingProps, type Plan } from "./components/Pricing";
|
|
42
|
-
export {
|
|
43
|
-
Testimonials,
|
|
44
|
-
TestimonialCard,
|
|
45
|
-
type TestimonialsProps,
|
|
46
|
-
type TestimonialCardProps,
|
|
47
|
-
type Testimonial,
|
|
48
|
-
} from "./components/Testimonials";
|
|
49
|
-
export { CTA, type CTAProps } from "./components/CTA";
|
|
50
|
-
export { FAQ, type FAQProps, type FaqItem } from "./components/FAQ";
|
|
51
|
-
export { Footer, type FooterProps, type FooterColumn, type FooterLink } from "./components/Footer";
|
|
52
|
-
export {
|
|
53
|
-
LanguageSwitcher,
|
|
54
|
-
type LanguageSwitcherProps,
|
|
55
|
-
type LanguageSwitcherOption,
|
|
56
|
-
type LanguageOption,
|
|
57
|
-
} from "./components/LanguageSwitcher";
|
|
58
|
-
export { Modal, type ModalProps } from "./components/Modal";
|
|
59
|
-
export { Newsletter, type NewsletterProps } from "./components/Newsletter";
|
|
60
|
-
export { Prose, ProseLead, type ProseProps, type ProseSize } from "./components/Prose";
|
|
61
|
-
export {
|
|
62
|
-
BlogCard,
|
|
63
|
-
BlogSection,
|
|
64
|
-
type BlogCardProps,
|
|
65
|
-
type BlogPost,
|
|
66
|
-
type BlogAuthor,
|
|
67
|
-
type BlogSectionProps,
|
|
68
|
-
} from "./components/Blog";
|
|
69
|
-
export {
|
|
70
|
-
Container,
|
|
71
|
-
Stack,
|
|
72
|
-
type ContainerProps,
|
|
73
|
-
type ContainerSize,
|
|
74
|
-
type StackProps,
|
|
75
|
-
type StackGap,
|
|
76
|
-
} from "./components/Container";
|
|
77
|
-
|
|
78
|
-
export { cn } from "./utils/cn";
|
|
79
|
-
export { getContrastText, type ColorInput } from "./utils/contrast";
|
|
80
|
-
export { useTokenForeground } from "./utils/useTokenForeground";
|
|
81
|
-
export { iso2ToFlagEmoji } from "./utils/iso2Flag";
|
|
82
|
-
|
|
83
|
-
export {
|
|
84
|
-
ArrowRight,
|
|
85
|
-
ArrowUpRight,
|
|
86
|
-
ArrowDown,
|
|
87
|
-
ArrowUp,
|
|
88
|
-
Check,
|
|
89
|
-
Plus,
|
|
90
|
-
X,
|
|
91
|
-
Menu,
|
|
92
|
-
ChevronDown,
|
|
93
|
-
ChevronRight,
|
|
94
|
-
ChevronLeft,
|
|
95
|
-
Zap,
|
|
96
|
-
ShieldCheck,
|
|
97
|
-
Layers,
|
|
98
|
-
Smartphone,
|
|
99
|
-
Gauge,
|
|
100
|
-
BarChart,
|
|
101
|
-
Users,
|
|
102
|
-
Star,
|
|
103
|
-
Quote,
|
|
104
|
-
Globe,
|
|
105
|
-
Mail,
|
|
106
|
-
Lock,
|
|
107
|
-
Clock,
|
|
108
|
-
DollarSign,
|
|
109
|
-
Code,
|
|
110
|
-
Terminal,
|
|
111
|
-
Send,
|
|
112
|
-
Play,
|
|
113
|
-
ExternalLink,
|
|
114
|
-
Sliders,
|
|
115
|
-
Database,
|
|
116
|
-
Box,
|
|
117
|
-
Cpu,
|
|
118
|
-
Palette,
|
|
119
|
-
Rocket,
|
|
120
|
-
} from "./icons";
|
package/src/styles/index.css
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Sans:opsz,wght@9..40,400;9..40,500;9..40,600&display=swap");
|
|
2
|
-
@import "tailwindcss";
|
|
3
|
-
@import "./theme.css";
|
|
4
|
-
|
|
5
|
-
@layer base {
|
|
6
|
-
html {
|
|
7
|
-
-webkit-tap-highlight-color: transparent;
|
|
8
|
-
scroll-behavior: smooth;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
body {
|
|
12
|
-
@apply bg-background text-foreground font-sans antialiased;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
::selection {
|
|
16
|
-
background-color: rgb(var(--color-primary) / 0.18);
|
|
17
|
-
}
|
|
18
|
-
}
|
package/src/utils/cn.ts
DELETED
package/src/utils/contrast.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Contrast utilities.
|
|
3
|
-
*
|
|
4
|
-
* The library ships paired semantic tokens (e.g. --color-primary /
|
|
5
|
-
* --color-on-primary) so explicit pairings stay safe. For the few places where
|
|
6
|
-
* a *dynamic* color paints a background (a `customColor` prop, a token-based
|
|
7
|
-
* highlight card...) we pick the text color that yields the **best WCAG
|
|
8
|
-
* contrast ratio** at runtime.
|
|
9
|
-
*
|
|
10
|
-
* Inputs may be hex colors, bare RGB channels ("21 128 61"), rgb() functions
|
|
11
|
-
* (`rgb(21 128 61 / 0.95)`) or CSS variable references
|
|
12
|
-
* (`rgb(var(--color-primary) / 0.85)`). Variable references are resolved
|
|
13
|
-
* against the live stylesheet before computing luminance, so a re-themed
|
|
14
|
-
* palette never produces a low-contrast combination.
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
export type ColorInput = string;
|
|
18
|
-
|
|
19
|
-
function readVariable(name: string): string {
|
|
20
|
-
if (typeof window === "undefined") return "";
|
|
21
|
-
return window
|
|
22
|
-
.getComputedStyle(document.documentElement)
|
|
23
|
-
.getPropertyValue(name)
|
|
24
|
-
.trim();
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Resolve `var(--x)` references against the live stylesheet. */
|
|
28
|
-
function resolveVars(input: string): string {
|
|
29
|
-
let str = input;
|
|
30
|
-
const refs = str.match(/var\(--[\w-]+/g) ?? [];
|
|
31
|
-
for (const ref of refs) {
|
|
32
|
-
const name = ref.replace(/^var\(/, "");
|
|
33
|
-
const resolved = readVariable(name);
|
|
34
|
-
if (resolved) str = str.split(ref).join(resolved);
|
|
35
|
-
}
|
|
36
|
-
return str;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface RGB {
|
|
40
|
-
r: number;
|
|
41
|
-
g: number;
|
|
42
|
-
b: number;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function channels(color: ColorInput): RGB | null {
|
|
46
|
-
let str = color.trim();
|
|
47
|
-
|
|
48
|
-
if (/^#([0-9a-f]{3}){1,2}$/i.test(str)) {
|
|
49
|
-
if (str.length === 4) {
|
|
50
|
-
str =
|
|
51
|
-
"#" +
|
|
52
|
-
str
|
|
53
|
-
.slice(1)
|
|
54
|
-
.split("")
|
|
55
|
-
.map((c) => c + c)
|
|
56
|
-
.join("");
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
r: parseInt(str.slice(1, 3), 16),
|
|
60
|
-
g: parseInt(str.slice(3, 5), 16),
|
|
61
|
-
b: parseInt(str.slice(5, 7), 16),
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const resolved = resolveVars(str);
|
|
66
|
-
|
|
67
|
-
// Normalize rgb()/rgba() separators ("r g b / a", "r, g, b") and bare channels.
|
|
68
|
-
const normalized = resolved.replace(/[()/;,]/g, " ");
|
|
69
|
-
const parts = normalized.match(/-?\d+(\.\d+)?/g)?.map(Number) ?? [];
|
|
70
|
-
if (parts.length < 3) return null;
|
|
71
|
-
// Alpha (4th component) is ignored: these colors paint opaque surfaces and
|
|
72
|
-
// mixing against an unknown backdrop can't be modelled reliably.
|
|
73
|
-
const [r, g, b] = parts;
|
|
74
|
-
return {
|
|
75
|
-
r: Math.max(0, Math.min(255, Math.round(r))),
|
|
76
|
-
g: Math.max(0, Math.min(255, Math.round(g))),
|
|
77
|
-
b: Math.max(0, Math.min(255, Math.round(b))),
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
function relativeLuminance(color: ColorInput): number {
|
|
82
|
-
const c = channels(color);
|
|
83
|
-
if (!c) return 0;
|
|
84
|
-
const lin = [c.r, c.g, c.b]
|
|
85
|
-
.map((v) => v / 255)
|
|
86
|
-
.map((v) => (v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4)));
|
|
87
|
-
return 0.2126 * lin[0] + 0.7152 * lin[1] + 0.0722 * lin[2];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function contrastRatio(lumA: number, lumB: number): number {
|
|
91
|
-
const [hi, lo] = lumA > lumB ? [lumA, lumB] : [lumB, lumA];
|
|
92
|
-
return (hi + 0.05) / (lo + 0.05);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Returns the more readable of the two candidate text colors for a given
|
|
97
|
-
* background. Both candidates are evaluated with the WCAG contrast formula and
|
|
98
|
-
* the winning (highest ratio) color is returned — not a fixed luminance
|
|
99
|
-
* breakpoint — so mid-luminance backgrounds (amber, pastels, light violet…)
|
|
100
|
-
* always fall on the correct side.
|
|
101
|
-
*/
|
|
102
|
-
export function getContrastText(bg: ColorInput, light = "#ffffff", dark = "#0f172a"): string {
|
|
103
|
-
const lumBg = relativeLuminance(bg);
|
|
104
|
-
const lumLight = relativeLuminance(light);
|
|
105
|
-
const lumDark = relativeLuminance(dark);
|
|
106
|
-
return contrastRatio(lumBg, lumLight) >= contrastRatio(lumBg, lumDark) ? light : dark;
|
|
107
|
-
}
|
package/src/utils/iso2Flag.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert an ISO 3166-1 alpha-2 country code (e.g. "TR", "us") to its flag emoji
|
|
3
|
-
* via regional indicator symbols. Returns `""` when the code is not a real
|
|
4
|
-
* country code (e.g. a language code like "en"), so callers can fall back.
|
|
5
|
-
*
|
|
6
|
-
* iso2ToFlagEmoji("tr") // 🇹🇷
|
|
7
|
-
* iso2ToFlagEmoji("en") // "" (not a country)
|
|
8
|
-
* iso2ToFlagEmoji("") // ""
|
|
9
|
-
*/
|
|
10
|
-
const ISO3166 = new Set(
|
|
11
|
-
`AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BF BG BH BI BJ BL BM BN BO BQ BR BS BT BV BW BY BZ
|
|
12
|
-
CA CC CD CF CG CH CI CK CL CM CN CO CR CU CV CW CX CY CZ DE DJ DK DM DO DZ EC EE EG EH ER ES ET FI FJ FK FM FO FR
|
|
13
|
-
GA GB GD GE GF GG GH GI GL GM GN GP GQ GR GS GT GU GW GY HK HM HN HR HT HU ID IE IL IM IN IO IQ IR IS IT JE JM JO
|
|
14
|
-
JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR
|
|
15
|
-
MS MT MU MV MW MX MY MZ NA NC NE NF NG NI NL NO NP NR NU NZ OM PA PE PF PG PH PK PL PM PN PR PS PT PW PY QA RE RO
|
|
16
|
-
RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SN SO SR SS ST SV SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV
|
|
17
|
-
TW TZ UA UG UM US UY UZ VA VC VE VG VI VN VU WF WS YE YT ZA ZM ZW`.split(/\s+/),
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
export function iso2ToFlagEmoji(code: string): string {
|
|
21
|
-
const upper = code.toUpperCase();
|
|
22
|
-
if (ISO3166.has(upper)) {
|
|
23
|
-
return String.fromCodePoint(0x1f1e6 + upper.charCodeAt(0) - 65, 0x1f1e6 + upper.charCodeAt(1) - 65);
|
|
24
|
-
}
|
|
25
|
-
return "";
|
|
26
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { getContrastText } from "./contrast";
|
|
4
|
-
|
|
5
|
-
function readChannel(variable: string): string {
|
|
6
|
-
if (typeof window === "undefined") return "";
|
|
7
|
-
return window
|
|
8
|
-
.getComputedStyle(document.documentElement)
|
|
9
|
-
.getPropertyValue(variable)
|
|
10
|
-
.trim();
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Reads a `--color-*` token from the live stylesheet and returns a text color
|
|
15
|
-
* that is always readable against it. Recomputes whenever the palette changes
|
|
16
|
-
* at runtime (e.g. the Storybook theme switcher or an app-level theme swap).
|
|
17
|
-
*/
|
|
18
|
-
export function useTokenForeground(variable: string, fallback = "#ffffff"): string {
|
|
19
|
-
const [text, setText] = useState<string>(() => {
|
|
20
|
-
const value = readChannel(variable);
|
|
21
|
-
return value ? getContrastText(value) : fallback;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
const update = () => {
|
|
26
|
-
const value = readChannel(variable);
|
|
27
|
-
setText(value ? getContrastText(value) : fallback);
|
|
28
|
-
};
|
|
29
|
-
update();
|
|
30
|
-
const observer = new MutationObserver(update);
|
|
31
|
-
observer.observe(document.documentElement, {
|
|
32
|
-
attributes: true,
|
|
33
|
-
attributeFilter: ["style", "class"],
|
|
34
|
-
});
|
|
35
|
-
return () => observer.disconnect();
|
|
36
|
-
}, [variable, fallback]);
|
|
37
|
-
|
|
38
|
-
return text;
|
|
39
|
-
}
|
|
File without changes
|