Skip to content

Commit

Permalink
feat: Message styling changes (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hallidayo authored Oct 14, 2023
1 parent 6337858 commit a8f9395
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .changeset/empty-shrimps-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@supabase/auth-ui-shared': patch
'@supabase/auth-ui-react': patch
---

Message styling change
15 changes: 10 additions & 5 deletions packages/react/src/components/UI/Message.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,30 @@ import { Appearance } from '../../types'

const messageDefaultStyles = css({
fontFamily: '$bodyFontFamily',
fontSize: '$baseBodySize',
fontSize: '$baseInputSize',
marginBottom: '$labelBottomMargin',
display: 'block',
textAlign: 'center',
borderRadius: '0.375rem',
padding: '1.5rem 1rem',
lineHeight: '1rem',
color: '$messageText',
backgroundColor: '$messageBackground',
border: '1px solid $messageBorder',
variants: {
color: {
default: {
color: '$messageText',
},
danger: {
color: '$messageTextDanger',
backgroundColor: '$messageBackgroundDanger',
border: '1px solid $messageBorderDanger',
},
},
},
})

interface MessageProps extends React.HTMLAttributes<HTMLSpanElement> {
children: React.ReactNode
color?: 'default' | 'danger'
color?: 'danger'
appearance?: Appearance
}

Expand Down
4 changes: 4 additions & 0 deletions packages/shared/src/theming/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export type ThemeVariables = {
inputPlaceholder?: string
inputText?: string
messageText?: string
messageBackground?: string
messageBorder?: string
messageTextDanger?: string
messageBackgroundDanger?: string
messageBorderDanger?: string
anchorTextColor?: string
anchorTextHoverColor?: string
}
Expand Down
22 changes: 20 additions & 2 deletions packages/shared/src/theming/defaultThemes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ export const ThemeSupa: Theme = {
inputText: 'black',
inputLabelText: 'gray',
inputPlaceholder: 'darkgray',
messageText: 'gray',
messageTextDanger: 'red',
messageText: '#2b805a',
messageBackground: '#e7fcf1',
messageBorder: '#d0f3e1',
messageTextDanger: '#ff6369',
messageBackgroundDanger: '#fff8f8',
messageBorderDanger: '#822025',
anchorTextColor: 'gray',
anchorTextHoverColor: 'darkgray',
},
Expand Down Expand Up @@ -91,6 +95,10 @@ export const ThemeSupa: Theme = {
inputBorderFocus: 'gray',
inputText: 'white',
inputPlaceholder: 'darkgray',
messageText: '#85e0b7',
messageBackground: '#072719',
messageBorder: '#2b805a',
messageBackgroundDanger: '#1f1315',
},
},
}
Expand All @@ -109,6 +117,12 @@ export const ThemeMinimal: Theme = {
inputBorder: 'lightgray',
inputText: 'black',
inputPlaceholder: 'darkgray',
messageText: '#2b805a',
messageBackground: '#e7fcf1',
messageBorder: '#d0f3e1',
messageTextDanger: '#ff6369',
messageBackgroundDanger: '#fff8f8',
messageBorderDanger: '#822025',
},
space: {
spaceSmall: '4px',
Expand Down Expand Up @@ -150,6 +164,10 @@ export const ThemeMinimal: Theme = {
inputBorder: 'gray',
inputText: 'black',
inputPlaceholder: 'darkgray',
messageText: '#85e0b7',
messageBackground: '#072719',
messageBorder: '#2b805a',
messageBackgroundDanger: '#1f1315',
},
},
}

0 comments on commit a8f9395

Please sign in to comment.