From 8186284ded2479c65ccd28cc7592d8546a715f40 Mon Sep 17 00:00:00 2001 From: Florian BOUILLON Date: Wed, 31 Mar 2021 13:51:04 +0200 Subject: [PATCH] GradientBackground is now stable Signed-off-by: Florian BOUILLON --- .../GradientBackground.module.styl | 21 +++++++------------ src/dzeio/GradientBackground/index.tsx | 8 ++++++- src/dzeio/interfaces.ts | 2 +- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/dzeio/GradientBackground/GradientBackground.module.styl b/src/dzeio/GradientBackground/GradientBackground.module.styl index de2492c..4b90860 100644 --- a/src/dzeio/GradientBackground/GradientBackground.module.styl +++ b/src/dzeio/GradientBackground/GradientBackground.module.styl @@ -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 diff --git a/src/dzeio/GradientBackground/index.tsx b/src/dzeio/GradientBackground/index.tsx index bd55cbf..8645fe9 100644 --- a/src/dzeio/GradientBackground/index.tsx +++ b/src/dzeio/GradientBackground/index.tsx @@ -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 { public render = () => ( -
+
{this.props.children}
) diff --git a/src/dzeio/interfaces.ts b/src/dzeio/interfaces.ts index e911b7d..5b6b632 100644 --- a/src/dzeio/interfaces.ts +++ b/src/dzeio/interfaces.ts @@ -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 { color?: string