mirror of
https://github.com/plankanban/planka.git
synced 2025-12-26 09:15:01 +03:00
Background gradients, migrate from CSS to SCSS, remove !important
This commit is contained in:
33
client/src/components/Background/Background.jsx
Normal file
33
client/src/components/Background/Background.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
import upperFirst from 'lodash/upperFirst';
|
||||
import camelCase from 'lodash/camelCase';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import styles from './Background.module.scss';
|
||||
import globalStyles from '../../styles.module.scss';
|
||||
|
||||
const Background = ({ type, name, imageUrl }) => (
|
||||
<div
|
||||
className={classNames(
|
||||
styles.wrapper,
|
||||
type === 'gradient' && globalStyles[`background${upperFirst(camelCase(name))}`],
|
||||
)}
|
||||
style={{
|
||||
background: type === 'image' && `url("${imageUrl}") center / cover`,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
Background.propTypes = {
|
||||
type: PropTypes.string.isRequired,
|
||||
name: PropTypes.string,
|
||||
imageUrl: PropTypes.string,
|
||||
};
|
||||
|
||||
Background.defaultProps = {
|
||||
name: undefined,
|
||||
imageUrl: undefined,
|
||||
};
|
||||
|
||||
export default Background;
|
||||
8
client/src/components/Background/Background.module.scss
Normal file
8
client/src/components/Background/Background.module.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
:global(#app) {
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
3
client/src/components/Background/index.js
Normal file
3
client/src/components/Background/index.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import Background from './Background';
|
||||
|
||||
export default Background;
|
||||
Reference in New Issue
Block a user