mirror of
https://github.com/zhigang1992/react-content-loader.git
synced 2026-04-26 23:04:56 +08:00
New primaryOpacity and secondaryOpacity props to work around Safari rgba bug (#96)
* Safari and iOS transparency workaround Introduction of `primaryOpacity` and `secondaryOpacity` * Remove primaryOpacity/secondaryOpacity conditional props type * Add tests for primaryOpacity and secondaryOpacity
This commit is contained in:
committed by
Danilo Woznica
parent
29ba1d12c1
commit
3a72b14f50
@@ -33,7 +33,7 @@ const Wrap = (props: WrapProps): React.Element<*> => {
|
||||
<clipPath id={idClip}>{props.children}</clipPath>
|
||||
|
||||
<linearGradient id={idGradient}>
|
||||
<stop offset="0%" stopColor={props.primaryColor}>
|
||||
<stop offset="0%" stopColor={props.primaryColor} stopOpacity={props.primaryOpacity}>
|
||||
{props.animate ? (
|
||||
<animate
|
||||
attributeName="offset"
|
||||
@@ -43,7 +43,7 @@ const Wrap = (props: WrapProps): React.Element<*> => {
|
||||
/>
|
||||
) : null}
|
||||
</stop>
|
||||
<stop offset="50%" stopColor={props.secondaryColor}>
|
||||
<stop offset="50%" stopColor={props.secondaryColor} stopOpacity={props.secondaryOpacity}>
|
||||
{props.animate ? (
|
||||
<animate
|
||||
attributeName="offset"
|
||||
@@ -53,7 +53,7 @@ const Wrap = (props: WrapProps): React.Element<*> => {
|
||||
/>
|
||||
) : null}
|
||||
</stop>
|
||||
<stop offset="100%" stopColor={props.primaryColor}>
|
||||
<stop offset="100%" stopColor={props.primaryColor} stopOpacity={props.primaryOpacity}>
|
||||
{props.animate ? (
|
||||
<animate
|
||||
attributeName="offset"
|
||||
|
||||
@@ -18,6 +18,8 @@ export type Props = {
|
||||
preserveAspectRatio: string,
|
||||
primaryColor: string,
|
||||
secondaryColor: string,
|
||||
primaryOpacity: number,
|
||||
secondaryOpacity: number,
|
||||
style: { [key: string]: any },
|
||||
uniquekey: string,
|
||||
}
|
||||
@@ -30,6 +32,8 @@ export const defaultProps = {
|
||||
preserveAspectRatio: 'xMidYMid meet',
|
||||
primaryColor: '#f0f0f0',
|
||||
secondaryColor: '#e0e0e0',
|
||||
primaryOpacity: 1,
|
||||
secondaryOpacity: 1,
|
||||
}
|
||||
|
||||
const InitialComponent = props => (
|
||||
|
||||
Reference in New Issue
Block a user