You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					39 lines
				
				721 B
			
		
		
			
		
	
	
					39 lines
				
				721 B
			| 
											3 years ago
										 | "use strict"; | ||
|  | 
 | ||
|  | exports.__esModule = true; | ||
|  | exports["default"] = hideText; | ||
|  | 
 | ||
|  | /** | ||
|  |  * 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', | ||
|  |  * } | ||
|  |  */ | ||
|  | function hideText() { | ||
|  |   return { | ||
|  |     textIndent: '101%', | ||
|  |     overflow: 'hidden', | ||
|  |     whiteSpace: 'nowrap' | ||
|  |   }; | ||
|  | } | ||
|  | 
 | ||
|  | module.exports = exports.default; |