Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99531874
borders.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jan 25, 06:03
Size
2 KB
Mime Type
text/x-java
Expires
Mon, Jan 27, 06:03 (2 d)
Engine
blob
Format
Raw Data
Handle
23818281
Attached To
rOACCT Open Access Compliance Check Tool (OACCT)
borders.js
View Options
import responsivePropType from './responsivePropType';
import style from './style';
import compose from './compose';
import { createUnaryUnit, getValue } from './spacing';
import { handleBreakpoints } from './breakpoints';
export function borderTransform(value) {
if (typeof value !== 'number') {
return value;
}
return `${value}px solid`;
}
export const border = style({
prop: 'border',
themeKey: 'borders',
transform: borderTransform
});
export const borderTop = style({
prop: 'borderTop',
themeKey: 'borders',
transform: borderTransform
});
export const borderRight = style({
prop: 'borderRight',
themeKey: 'borders',
transform: borderTransform
});
export const borderBottom = style({
prop: 'borderBottom',
themeKey: 'borders',
transform: borderTransform
});
export const borderLeft = style({
prop: 'borderLeft',
themeKey: 'borders',
transform: borderTransform
});
export const borderColor = style({
prop: 'borderColor',
themeKey: 'palette'
});
export const borderTopColor = style({
prop: 'borderTopColor',
themeKey: 'palette'
});
export const borderRightColor = style({
prop: 'borderRightColor',
themeKey: 'palette'
});
export const borderBottomColor = style({
prop: 'borderBottomColor',
themeKey: 'palette'
});
export const borderLeftColor = style({
prop: 'borderLeftColor',
themeKey: 'palette'
});
// false positive
// eslint-disable-next-line react/function-component-definition
export const borderRadius = props => {
if (props.borderRadius !== undefined && props.borderRadius !== null) {
const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');
const styleFromPropValue = propValue => ({
borderRadius: getValue(transformer, propValue)
});
return handleBreakpoints(props, props.borderRadius, styleFromPropValue);
}
return null;
};
borderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {
borderRadius: responsivePropType
} : {};
borderRadius.filterProps = ['borderRadius'];
const borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);
export default borders;
Event Timeline
Log In to Comment