123456789101112131415161718192021222324252627282930313233343536 |
- // @flow
- import type { Styles } from '../types/style'
- /**
- * CSS to hide text to show a background image in a SEO-friendly way.
- *
- * @example
- * // Styles as object usage
- * const styles = {
- * 'backgroundImage': 'url(logo.png)',
- * ...hideText(),
- * }
- *
- * // styled-components usage
- * const div = styled.div`
- * backgroundImage: url(logo.png);
- * ${hideText()};
- * `
- *
- * // CSS as JS Output
- *
- * 'div': {
- * 'backgroundImage': 'url(logo.png)',
- * 'textIndent': '101%',
- * 'overflow': 'hidden',
- * 'whiteSpace': 'nowrap',
- * }
- */
- export default function hideText(): Styles {
- return {
- textIndent: '101%',
- overflow: 'hidden',
- whiteSpace: 'nowrap',
- }
- }
|