HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/kommabasic.nl/resources/sass/5-Components/_components.text-button.scss
// Component settings: Text Button
// ------------------------------------------

$c-textbutton: (
	'color':			palette(feedback, action),
	'colorAlt':			palette(neutral, 0),
);

// ------------------------------------------

/**
 * 1. Color gets inherited and used for nested elements with 'currentColor' property
 * 2. Reset default button styling
 */

.c-textbutton {
	@include disableOutlineForMouse;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	color: map-get($c-textbutton, 'color'); /* 1 */
	padding: 0; /* 2 */
	background-color: transparent; /* 2 */
	border: none; /* 2 */
	cursor: pointer;
	text-decoration: none;
	transition: color 0.3s;

	&:hover:not(:disabled) {
		color: scale-color(map-get($c-textbutton, 'color'), $lightness: -40%);
	}
	&:disabled {
		opacity: 0.5;
		cursor: not-allowed;
	}
	&:focus {
		outline-color: currentColor;
		outline-style: solid;
		outline-offset: 1px;
		outline-width: 2px;
	}
}

.c-textbutton__text {
	@include font-size(base);
}

.c-textbutton__icon {
	display: none; // By default icon is hidden
	position: relative;
	margin-left: space(1);
	transition: transform 0.3s;

	.c-textbutton:hover:not(:disabled) & {
		transform: translateX(3px);
	}

	.c-textbutton--icon &{
		display: block; // Show when has icon modifier
	}
}

// Change direction of icon (arrow)
.c-textbutton--is-reversed {
	.c-textbutton__text { order: 2;	}
	.c-textbutton__icon {
		order: 1;
		top: 1px;
		margin-left: 0;
		margin-right: space(1);
		transform: rotate(0.5turn);
	}
	&:hover:not(:disabled) .c-textbutton__icon {
		transform: rotate(0.5turn) translateX(3px);
	}
}