Files
Shifted/node_modules/polished/lib/mixins/clearFix.js.flow
2026-02-10 01:14:19 +00:00

36 lines
627 B
Plaintext

// @flow
import type { Styles } from '../types/style'
/**
* CSS to contain a float (credit to CSSMojo).
*
* @example
* // Styles as object usage
* const styles = {
* ...clearFix(),
* }
*
* // styled-components usage
* const div = styled.div`
* ${clearFix()}
* `
*
* // CSS as JS Output
*
* '&::after': {
* 'clear': 'both',
* 'content': '""',
* 'display': 'table'
* }
*/
export default function clearFix(parent?: string = '&'): Styles {
const pseudoSelector = `${parent}::after`
return {
[pseudoSelector]: {
clear: 'both',
content: '""',
display: 'table',
},
}
}