.components-accessible-toolbar {
	display: inline-flex;
	border: $border-width solid $gray-900;
	border-radius: $radius-small;
	flex-shrink: 0;

	& > .components-toolbar-group:last-child {
		border-right: none;
	}

	&.is-unstyled {
		border: none;

		& > .components-toolbar-group {
			border-right: none;
		}

	}
}

.components-accessible-toolbar,
.components-toolbar {

	&[aria-orientation="vertical"] {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.components-button {
		position: relative;
		height: $block-toolbar-height;
		z-index: 1;

		// Give all buttons extra padding to fit text.
		padding-left: $grid-unit-20;
		padding-right: $grid-unit-20;

		// Don't show the focus inherited by the Button component.
		&:focus:not(:disabled) {
			box-shadow: none;
			outline: none;
		}

		// Focus and toggle pseudo elements.
		&::before {
			content: "";
			position: absolute;
			display: block;
			border-radius: $radius-small;
			height: $grid-unit-40;

			// Position the focus rectangle.
			left: $grid-unit-10;
			right: $grid-unit-10;
			z-index: -1;

			// Animate in.
			animation: components-button__appear-animation 0.1s ease;
			animation-fill-mode: forwards;
			@include reduce-motion("animation");
		}

		svg {
			position: relative;

			// Center the icon inside.
			margin-left: auto;
			margin-right: auto;
		}

		// Toggled style.
		&.is-pressed {
			background: transparent;

			&:hover {
				background: transparent;
			}

			&::before {
				background: $gray-900;
			}
		}

		// Focus style.
		&:focus::before {
			@include block-toolbar-button-style__focus();
		}

		// Ensure the icon buttons remain square.
		// This needs specificity.
		&.has-icon.has-icon {
			// Reduce the default padding when a button only has an icon.
			padding-left: $grid-unit-10;
			padding-right: $grid-unit-10;
			min-width: $block-toolbar-height;
		}
	}
}


@keyframes components-button__appear-animation {
	from {
		transform: scaleY(0);
	}
	to {
		transform: scaleY(1);
	}
}
