Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
webf
react-webf
Commits
6bd44420
Commit
6bd44420
authored
Apr 06, 2022
by
Lucas Breton
Browse files
Add box light variant
parent
bbcb6a71
Pipeline
#2961
failed with stage
in 2 minutes and 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/Box/Box.styles.js
View file @
6bd44420
...
@@ -12,6 +12,7 @@ export default (theme) => ({
...
@@ -12,6 +12,7 @@ export default (theme) => ({
},
},
plainVariant
:
{},
plainVariant
:
{},
lightVariant
:
{},
textVariant
:
{},
textVariant
:
{},
outlineVariant
:
{},
outlineVariant
:
{},
gradientVariant
:
{},
gradientVariant
:
{},
...
@@ -77,6 +78,23 @@ export default (theme) => ({
...
@@ -77,6 +78,23 @@ export default (theme) => ({
},
},
},
},
'
&$lightVariant
'
:
{
backgroundColor
:
Color
(
theme
.
colors
.
palette
[
color
]).
alpha
(
0.25
).
string
(),
color
:
theme
.
colors
.
palette
[
color
],
'
&$interactive:not($muted)
'
:
{
'
&:hover, &:focus
'
:
{
color
:
Color
(
theme
.
colors
.
palette
[
color
]).
darken
(
0.25
).
string
(),
backgroundColor
:
Color
(
theme
.
colors
.
palette
[
color
]).
alpha
(
0.5
).
string
(),
},
'
&:active
'
:
{
color
:
Color
(
theme
.
colors
.
palette
[
color
]).
darken
(
0.35
).
string
(),
backgroundColor
:
Color
(
theme
.
colors
.
palette
[
color
]).
alpha
(
0.8
).
string
(),
},
},
},
'
&$gradientVariant
'
:
{
'
&$gradientVariant
'
:
{
backgroundColor
:
theme
.
colors
.
palette
[
color
],
backgroundColor
:
theme
.
colors
.
palette
[
color
],
backgroundImage
:
theme
.
colors
.
gradient
[
color
],
backgroundImage
:
theme
.
colors
.
gradient
[
color
],
...
@@ -141,7 +159,7 @@ export default (theme) => ({
...
@@ -141,7 +159,7 @@ export default (theme) => ({
.
string
()}
!important`
,
.
string
()}
!important`
,
},
},
'
&$plainVariant, &$gradientVariant
'
:
{
'
&$plainVariant,
&$lightVariant,
&$gradientVariant
'
:
{
backgroundColor
:
`
${
Color
(
theme
.
colors
.
disabled
)
backgroundColor
:
`
${
Color
(
theme
.
colors
.
disabled
)
.
fade
(
0.8
)
.
fade
(
0.8
)
.
string
()}
!important`
,
.
string
()}
!important`
,
...
...
src/Box/Box.tsx
View file @
6bd44420
...
@@ -93,7 +93,7 @@ export interface BoxProps {
...
@@ -93,7 +93,7 @@ export interface BoxProps {
*
*
* @default 'plain'
* @default 'plain'
*/
*/
variant
?:
'
text
'
|
'
outline
'
|
'
plain
'
|
'
gradient
'
;
variant
?:
'
text
'
|
'
outline
'
|
'
plain
'
|
'
gradient
'
|
'
light
'
;
}
}
const
Box
:
OverridableComponent
<
BoxProps
,
'
div
'
>
=
(
props
)
=>
{
const
Box
:
OverridableComponent
<
BoxProps
,
'
div
'
>
=
(
props
)
=>
{
...
...
src/Box/demos/Variants.js
View file @
6bd44420
...
@@ -52,7 +52,7 @@ class Variants extends PureComponent {
...
@@ -52,7 +52,7 @@ class Variants extends PureComponent {
return
(
return
(
<
Fragment
>
<
Fragment
>
<
Row
justifyContent
=
'
center
'
>
<
Row
justifyContent
=
'
center
'
>
{[
'
text
'
,
'
outline
'
,
'
plain
'
,
'
gradient
'
].
map
((
variant
)
=>
(
{[
'
text
'
,
'
outline
'
,
'
plain
'
,
'
gradient
'
,
'
light
'
].
map
((
variant
)
=>
(
<
Col
key
=
{
variant
}
xs
=
{
4
}
sm
=
{
3
}
lg
=
'
auto
'
>
<
Col
key
=
{
variant
}
xs
=
{
4
}
sm
=
{
3
}
lg
=
'
auto
'
>
<
input
<
input
id
=
{
`
${
variant
}
Variant`
}
id
=
{
`
${
variant
}
Variant`
}
...
...
Write
Preview
Supports
Markdown
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