Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
aa51c136
Commit
aa51c136
authored
Aug 10, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text and heading component styles
parent
a21554b1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
11 deletions
+43
-11
Heading.ts
theme/components/Heading.ts
+16
-6
Text.ts
theme/components/Text.ts
+25
-3
AccountNavLink.tsx
ui/navigation/AccountNavLink.tsx
+1
-1
MainNavLink.tsx
ui/navigation/MainNavLink.tsx
+1
-1
No files found.
theme/components/Heading.ts
View file @
aa51c136
import
type
{
ComponentStyleConfig
}
from
'
@chakra-ui/theme
'
;
import
type
{
ComponentStyleConfig
}
from
'
@chakra-ui/theme
'
;
import
type
{
SystemStyleInterpolation
}
from
'
@chakra-ui/theme-tools
'
;
import
{
mode
}
from
'
@chakra-ui/theme-tools
'
;
const
baseStyle
=
{
const
baseStyle
:
SystemStyleInterpolation
=
(
props
)
=>
{
return
{
fontWeight
:
'
500
'
,
fontWeight
:
'
500
'
,
letterSpacing
:
'
-0.5px
'
,
color
:
mode
(
'
blackAlpha.800
'
,
'
whiteAlpha.800
'
)(
props
),
};
};
};
// WIP
// designer promised to sync theme and page mock-ups
// so that's not the final point yet
const
sizes
=
{
const
sizes
=
{
lg
:
{
lg
:
{
fontSize
:
'
32px
'
,
fontSize
:
'
32px
'
,
lineHeight
:
'
40px
'
,
lineHeight
:
'
40px
'
,
letterSpacing
:
'
-0.5px
'
,
},
md
:
{
fontSize
:
'
24px
'
,
lineHeight
:
'
32px
'
,
},
sm
:
{
fontSize
:
'
18px
'
,
lineHeight
:
'
24px
'
,
},
},
};
};
...
...
theme/components/Text.ts
View file @
aa51c136
...
@@ -2,14 +2,36 @@ import type { ComponentStyleConfig } from '@chakra-ui/theme';
...
@@ -2,14 +2,36 @@ import type { ComponentStyleConfig } from '@chakra-ui/theme';
import
type
{
SystemStyleFunction
}
from
'
@chakra-ui/theme-tools
'
;
import
type
{
SystemStyleFunction
}
from
'
@chakra-ui/theme-tools
'
;
import
{
mode
}
from
'
@chakra-ui/theme-tools
'
;
import
{
mode
}
from
'
@chakra-ui/theme-tools
'
;
const
variantPrimary
:
SystemStyleFunction
=
(
props
)
=>
({
color
:
mode
(
'
blackAlpha.800
'
,
'
whiteAlpha.800
'
)(
props
),
});
const
variantSecondary
:
SystemStyleFunction
=
(
props
)
=>
({
const
variantSecondary
:
SystemStyleFunction
=
(
props
)
=>
({
color
:
mode
(
'
gray.500
'
,
'
gray.400
'
)(
props
),
color
:
mode
(
'
gray.500
'
,
'
gray.400
'
)(
props
),
});
});
const
Text
:
ComponentStyleConfig
=
{
const
variantAlternate
:
SystemStyleFunction
=
(
props
)
=>
({
variants
:
{
color
:
mode
(
'
blue.600
'
,
'
blue.300
'
)(
props
),
});
const
variantInherit
=
{
color
:
'
inherit
'
,
};
const
variants
=
{
primary
:
variantPrimary
,
secondary
:
variantSecondary
,
secondary
:
variantSecondary
,
},
alternate
:
variantAlternate
,
inherit
:
variantInherit
,
};
const
defaultProps
=
{
variant
:
'
primary
'
,
};
const
Text
:
ComponentStyleConfig
=
{
defaultProps
,
variants
,
};
};
export
default
Text
;
export
default
Text
;
ui/navigation/AccountNavLink.tsx
View file @
aa51c136
...
@@ -32,7 +32,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => {
...
@@ -32,7 +32,7 @@ const AccountNavLink = ({ text, pathname, icon }: Props) => {
>
>
<
HStack
spacing=
{
3
}
>
<
HStack
spacing=
{
3
}
>
<
Icon
as=
{
icon
}
boxSize=
"30px"
/>
<
Icon
as=
{
icon
}
boxSize=
"30px"
/>
<
Text
>
{
text
}
</
Text
>
<
Text
variant=
"inherit"
>
{
text
}
</
Text
>
</
HStack
>
</
HStack
>
</
Link
>
</
Link
>
</
NextLink
>
</
NextLink
>
...
...
ui/navigation/MainNavLink.tsx
View file @
aa51c136
...
@@ -34,7 +34,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => {
...
@@ -34,7 +34,7 @@ const MainNavLink = ({ text, pathname, icon }: Props) => {
<
HStack
justifyContent=
"space-between"
>
<
HStack
justifyContent=
"space-between"
>
<
HStack
spacing=
{
3
}
>
<
HStack
spacing=
{
3
}
>
<
Icon
as=
{
icon
}
boxSize=
"30px"
/>
<
Icon
as=
{
icon
}
boxSize=
"30px"
/>
<
Text
>
{
text
}
</
Text
>
<
Text
variant=
"inherit"
>
{
text
}
</
Text
>
</
HStack
>
</
HStack
>
<
ChevronRightIcon
boxSize=
{
6
}
/>
<
ChevronRightIcon
boxSize=
{
6
}
/>
</
HStack
>
</
HStack
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment