Skip to content

Commit

Permalink
Merge pull request #13 from hivemq/feature/add-link
Browse files Browse the repository at this point in the history
Feature / Add link with default underline
  • Loading branch information
RobinAtherton authored Jul 25, 2024
2 parents 977eb9a + 0ee88ef commit e3334e9
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 0 deletions.
5 changes: 5 additions & 0 deletions testing/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Buttons } from '@/views/Buttons'
import { Headings } from '@/views/Headings'
import { Colors } from '@/views/Colors'
import { SemanticColors } from '@/views/SemanticColors'
import {Links} from "@/views/Links.tsx";

function App() {
return (
Expand All @@ -29,6 +30,10 @@ function App() {
<Buttons />
</Box>
<hr />
<Heading variant="h1"> Links</Heading>
<Box p={8}>
<Links />
</Box>
</ChakraBaseProvider>
)
}
Expand Down
9 changes: 9 additions & 0 deletions testing/src/views/Links.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import {Link} from '@chakra-ui/react'

export function Links() {
return (
<>
<Link> DEFAULT </Link>
</>
)
}
29 changes: 29 additions & 0 deletions theme/src/components/link.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {defineStyle, defineStyleConfig} from "@chakra-ui/react";

const base = defineStyle({

})

const external = defineStyle({

})


const variants = {
base,
external,
}

export const linkTheme = defineStyleConfig({
baseStyle: {
fontSize: '1rem',
textDecoration: 'underline',
fontWeight: 500,
cursor: 'pointer !important',
_hover: {
cursor: 'pointer !important',
},
color: "blue.500"
},
variants
})
2 changes: 2 additions & 0 deletions theme/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { StyleFunctionProps, extendBaseTheme } from '@chakra-ui/react'
import { mode } from '@chakra-ui/theme-tools'
import { buttonTheme } from './components/button'
import { headingTheme } from './components/headings'
import { linkTheme } from "./components/link"

import * as colors from './foundations/colors'
import semanticColors from './style-guide/computedSemanticColors'
Expand All @@ -25,6 +26,7 @@ export const styles = {
export const components = {
Button: buttonTheme,
Heading: headingTheme,
Link: linkTheme
} as const

export const theme = extendBaseTheme({
Expand Down

0 comments on commit e3334e9

Please sign in to comment.