Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0690b70825 |
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
--background: #ffffff;
|
--background: #ffffff;
|
||||||
--card: #f9f9f9;
|
--card: #f9f9f9;
|
||||||
--foreground: #000612e6;
|
--foreground: #000f06e6;
|
||||||
--primary-cta: #15479c;
|
--primary-cta: #0a7039;
|
||||||
--primary-cta-text: #ffffff;
|
--primary-cta-text: #ffffff;
|
||||||
--secondary-cta: #f9f9f9;
|
--secondary-cta: #f9f9f9;
|
||||||
--secondary-cta-text: #000f06e6;
|
--secondary-cta-text: #000f06e6;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ interface SvgTextLogoProps {
|
|||||||
fontSize?: number;
|
fontSize?: number;
|
||||||
fontWeight?: number | string;
|
fontWeight?: number | string;
|
||||||
letterSpacing?: number;
|
letterSpacing?: number;
|
||||||
fill?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
||||||
@@ -15,28 +14,27 @@ const SvgTextLogo: React.FC<SvgTextLogoProps> = ({
|
|||||||
fontSize = 48,
|
fontSize = 48,
|
||||||
fontWeight = 700,
|
fontWeight = 700,
|
||||||
letterSpacing = 0,
|
letterSpacing = 0,
|
||||||
fill = 'currentColor',
|
|
||||||
}) => {
|
}) => {
|
||||||
const textLength = text.length;
|
const svgWidth = text.length * (fontSize * 0.6) + 40;
|
||||||
const charWidth = fontSize * 0.6;
|
const svgHeight = fontSize + 20;
|
||||||
const width = charWidth * textLength + letterSpacing * (textLength - 1);
|
|
||||||
const height = fontSize * 1.2;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
viewBox={`0 0 ${width} ${height}`}
|
width={svgWidth}
|
||||||
|
height={svgHeight}
|
||||||
|
viewBox={`0 0 ${svgWidth} ${svgHeight}`}
|
||||||
className={className}
|
className={className}
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
preserveAspectRatio="xMidYMid meet"
|
|
||||||
>
|
>
|
||||||
<text
|
<text
|
||||||
x="0"
|
x="20"
|
||||||
y={fontSize}
|
y={fontSize + 5}
|
||||||
fontSize={fontSize}
|
fontSize={fontSize}
|
||||||
fontWeight={fontWeight}
|
fontWeight={fontWeight}
|
||||||
fill={fill}
|
|
||||||
letterSpacing={letterSpacing}
|
letterSpacing={letterSpacing}
|
||||||
dominantBaseline="middle"
|
fill="currentColor"
|
||||||
|
dominantBaseline="alphabetic"
|
||||||
|
textAnchor="start"
|
||||||
>
|
>
|
||||||
{text}
|
{text}
|
||||||
</text>
|
</text>
|
||||||
|
|||||||
Reference in New Issue
Block a user