mirror of
https://github.com/dzeiocom/components.git
synced 2025-04-22 10:52:16 +00:00
GradientBackground is now stable
Signed-off-by: Florian BOUILLON <florian.bouillon@delta-wings.net>
This commit is contained in:
parent
e173bd2a37
commit
8186284ded
@ -1,34 +1,29 @@
|
||||
@import "../config"
|
||||
|
||||
$transparent = 75%
|
||||
$transparent = 15%
|
||||
|
||||
.back
|
||||
transition all $transition
|
||||
background linear-gradient(to left, $default, transparentify($default, $transparent))
|
||||
background $mainGradient
|
||||
|
||||
.primary
|
||||
$color = $primary
|
||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
||||
|
||||
.secondary
|
||||
$color = $secondary
|
||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
||||
&.fullscreen
|
||||
min-height 100vh
|
||||
|
||||
.info
|
||||
$color = $info
|
||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
||||
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||
|
||||
.success
|
||||
$color = $success
|
||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
||||
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||
|
||||
.danger
|
||||
$color = $danger
|
||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
||||
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||
|
||||
.warning
|
||||
$color = $warning
|
||||
background linear-gradient(to left, $color, transparentify($color, $transparent))
|
||||
background linear-gradient(to left, $color, lighten($color, $transparent))
|
||||
|
||||
@media (prefers-color-scheme dark)
|
||||
.back
|
||||
|
@ -8,12 +8,18 @@ interface Props {
|
||||
color?: ColorType
|
||||
className?: string
|
||||
children: React.ReactNode
|
||||
fullscreen?: boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Make the background a linear-gradient
|
||||
*
|
||||
* @version 1.0.0
|
||||
*/
|
||||
export default class GradientBackground extends React.Component<Props> {
|
||||
|
||||
public render = () => (
|
||||
<div className={buildClassName([css.back], [css[this.props.color as string], this.props.color], [this.props.className])}>
|
||||
<div className={buildClassName(css.back, [css[this.props.color as string], this.props.color], this.props.className)}>
|
||||
{this.props.children}
|
||||
</div>
|
||||
)
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { SVGAttributes } from 'react'
|
||||
|
||||
export type ColorType = 'primary' | 'info' | 'success' | 'error' | 'warning'
|
||||
export type ColorType = 'info' | 'success' | 'error' | 'warning'
|
||||
|
||||
export interface IconProps extends SVGAttributes<SVGElement> {
|
||||
color?: string
|
||||
|
Loading…
x
Reference in New Issue
Block a user