polished#hideVisually TypeScript Examples

The following examples show how to use polished#hideVisually. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HeaderBar.style.ts    From design-system with Apache License 2.0 6 votes vote down vote up
ContentRight = styled(ContentArea).attrs({
	className: 'header-bar__content--right',
})`
	.btn--is-active {
		&,
		&:focus,
		&:hover,
		&:active {
			color: ${tokens.colors.gray[0]};
			background: none;
			border: none;
		}
	}

	// Display Toggle labels for mobiles and tablets
	.btn__text--hidden {
		position: static;
		clip: none;
		height: auto;
		width: auto;
	}

	@media only screen and (min-width: ${tokens.breakpoints.l}) {
		margin-left: auto;

		${Item} + ${Item} {
			${borderLeft}
		}

		.btn__text--hidden {
			${hideVisually()};
		}
	}
`
Example #2
Source File: ThemeProvider.style.ts    From design-system with Apache License 2.0 6 votes vote down vote up
GlobalStyle = createGlobalStyle`  
	html {
		/* 1rem = 10px */
		font-size: 62.5%;
	}
	
	body {
		margin: 0;
		padding: 0;
		font-family: 'Source Sans Pro', sans-serif;
		font-size: 14px;
		color: ${({ theme }) => theme?.colors.textColor};
		background: ${({ theme }) => theme?.colors.backgroundColor};
	}

	a {
		text-decoration: none;
	}
	
	[role="list"]  {
		margin: 0;
		padding: 0;
	}
	
	.focus-outline-hidden *:focus {
		outline: none;
	}

	::selection {
		color: ${tokens.colors.gray[900]};
		background-color: ${tokens.colors.coral[100]};
	}
	
	.sr-only {
		${hideVisually()}
	}
`
Example #3
Source File: HeaderBar.style.ts    From design-system with Apache License 2.0 5 votes vote down vote up
MenuDisclosure = styled(Button).attrs({
	className: 'header-bar__menu-disclosure',
})`
	margin-left: auto;
	padding: 1.5rem;
	min-height: 4.8rem;
	border: none;
	border-radius: 0;
	overflow: hidden;

	&,
	&:hover,
	&:focus,
	&:active {
		color: ${tokens.colors.gray[0]};
	}

	&:hover {
		background: ${transparentize(0.8, tokens.colors.gray[0])};
	}

	&:active {
		background: ${transparentize(0.9, tokens.colors.gray[0])};
	}

	&.btn {
		.btn__icon {
			margin: 0;
		}
		.btn__text {
			${hideVisually()};
		}
	}

	rect {
		transform-origin: 50% 50%;
		transition: transform ${tokens.transitions.fast};
	}

	&[aria-expanded='true'] {
		position: fixed;
		top: 0;
		right: 0;
		z-index: ${tokens.zIndices.onTop};

		rect {
			transform: scaleX(0);

			&:first-child {
				transform: translate(-0.5rem, 0.5rem) rotate(45deg);
			}

			&:last-child {
				transform: translate(-0.5rem, -0.5rem) rotate(-45deg);
			}
		}
	}
`