<div>
    <h3>Small</h3>
    <input type="checkbox" class="acl-toggle" id="switch-small" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--small" data-unchecked-icon="acl_nostock_product_badge" data-checked-icon="acl_done_small" for="switch-small"></label>
</div>

<div>
    <h3>Medium</h3>
    <input type="checkbox" class="acl-toggle" id="switch-medium" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--medium" data-unchecked-icon="acl_nostock_product_badge" data-checked-icon="acl_done_small" for="switch-medium"></label>
</div>

<div>
    <h3>Large</h3>
    <input type="checkbox" class="acl-toggle" id="switch-large" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--large" data-unchecked-icon="acl_nostock_product_badge" data-checked-icon="acl_done_small" for="switch-large"></label>
</div>

<div>
    <h3>Large (Alternative icons provided as data attributes)</h3>
    <input type="checkbox" class="acl-toggle" id="switch-large-alt" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--large" data-unchecked-icon="acl_lowstock_product_badge" data-checked-icon="acl_finished_status" for="switch-large-alt"></label>
</div>

<div>
    <h3>Custom Colours (See <a href="https://aforza.atlassian.net/wiki/spaces/ENGINEERIN/pages/1431699457/Toggle+Component" target="_blank">documentation</a> for variations available)</h3>
    <input type="checkbox" class="acl-toggle" id="switch-large-colours-1" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--icon-off-orange acl-toggle__icon-label--icon-on-orange acl-toggle__icon-label--handle-background-on-purple acl-toggle__icon-label--track-background-on-orange acl-toggle__icon-label--large" data-unchecked-icon="acl_lowstock_product_badge" data-checked-icon="acl_finished_status" for="switch-large-colours-1"></label>
</div>
<div>
    <h3>Small</h3>
    <input type="checkbox" class="acl-toggle" id="switch-small" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--small" data-unchecked-icon="acl_nostock_product_badge"
        data-checked-icon="acl_done_small" for="switch-small"></label>
</div>

<div>
    <h3>Medium</h3>
    <input type="checkbox" class="acl-toggle" id="switch-medium" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--medium" data-unchecked-icon="acl_nostock_product_badge"
        data-checked-icon="acl_done_small" for="switch-medium"></label>
</div>

<div>
    <h3>Large</h3>
    <input type="checkbox" class="acl-toggle" id="switch-large" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--large" data-unchecked-icon="acl_nostock_product_badge"
        data-checked-icon="acl_done_small" for="switch-large"></label>
</div>

<div>
    <h3>Large (Alternative icons provided as data attributes)</h3>
    <input type="checkbox" class="acl-toggle" id="switch-large-alt" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--large" data-unchecked-icon="acl_lowstock_product_badge"
        data-checked-icon="acl_finished_status" for="switch-large-alt"></label>
</div>


<div>
    <h3>Custom Colours (See <a href="https://aforza.atlassian.net/wiki/spaces/ENGINEERIN/pages/1431699457/Toggle+Component" target="_blank">documentation</a> for variations available)</h3>
    <input type="checkbox" class="acl-toggle" id="switch-large-colours-1" />
    <label class="acl-toggle__icon-label acl-toggle__icon-label--icon-off-orange acl-toggle__icon-label--icon-on-orange acl-toggle__icon-label--handle-background-on-purple acl-toggle__icon-label--track-background-on-orange acl-toggle__icon-label--large" data-unchecked-icon="acl_lowstock_product_badge"
        data-checked-icon="acl_finished_status" for="switch-large-colours-1"></label>
</div>
/* No context defined. */
  • Content:
    .acl-text-toggle {
    	width: 100%;
    	background-color: $white;
    	display: flex;
    
    	&__container {
    		height: 35px;
    		display: flex;
    
    		&--shadow {
    			box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
    		}
    	}
    
    	&__label {
    		text-align: center;
    		padding: 8px 25px;
    		margin-right: -1px;
    		transition: all 0.1s ease-in-out;
    		color: rgba(0, 0, 0, 0.5);
    		font-size: 12px;
    		font-weight: 600;
    		letter-spacing: 0;
    
    		&:hover {
    			cursor: pointer;
    		}
    
    		&--fixed-width {
    			max-width: 60px;
    			text-overflow: ellipsis;
    			white-space: nowrap;
    			overflow: hidden;
    		}
    	}
    
    	&__input {
    		position: absolute !important;
    		clip: rect(0, 0, 0, 0);
    		height: 1px;
    		width: 1px;
    		border: 0;
    		overflow: hidden;
    	}
    
    	input:checked + label {
    		background-color: $white;
    		z-index: 2;
    		border: 1px solid #e8ebf8; // Candidate for ACL styleguide
    		border-radius: 15.5px;
    		box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.15);
    		font-size: 12px;
    		font-weight: 600;
    		letter-spacing: 0;
    		line-height: 1.2;
    		color: rgba(0, 0, 0, 0.75);
    	}
    
    	&--coloured {
    		&-blue {
    			input + label {
    				border: 1px solid #93c3ea; // Candidate for ACL styleguide
    				box-shadow: none;
    				border-radius: 6px 0 0 6px;
    				font-weight: normal;
    			}
    
    			input:checked + label {
    				background-color: #93c3ea;
    				border: 2px solid #25547e; // Candidate for ACL styleguide
    				border-radius: 6px 0 0 6px;
    				box-shadow: none;
    			}
    
    			input:checked:nth-of-type(2) + label {
    				border-radius: 0 6px 6px 0;
    			}
    
    			input:not(:checked):nth-of-type(2) + label {
    				border-radius: 0 6px 6px 0;
    			}
    		}
    	}
    }
    
  • URL: /components/raw/toggle/acl-text-toggle.scss
  • Filesystem Path: src/components/toggle/acl-text-toggle.scss
  • Size: 1.6 KB
  • Content:
    .acl-toggle {
    	height: 0;
    	width: 0;
    	display: none;
    
    	&:disabled + .acl-toggle__label {
    		filter: grayscale(100%);
    		cursor: not-allowed;
    	}
    
    	&:checked + .acl-toggle__label {
    		background: #64f0e6;
    		box-shadow: inset 0 3px 4px 0 rgba(18, 30, 27, 0.3);
    	}
    
    	&:checked + .acl-toggle__label:after {
    		left: calc(100% + 2px);
    		transform: translateX(-100%);
    		border: 1px solid #2cbcb2;
    		background-color: $teal;
    		box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    	}
    
    	&:checked + .acl-toggle__icon-label {
    		&:after {
    			left: calc(100% + 2px);
    			transform: translateX(-100%);
    			content: attr(data-checked-icon);
    			font-size: 14px;
    			line-height: 1.6;
    			color: $white;
    			border: 1px solid #2cbcb2;
    			background-color: $teal;
    			box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    		}
    
    		&--icon-on {
    			&-orange {
    				&:after {
    					color: $orange;
    				}
    			}
    
    			&-dark-blue {
    				&:after {
    					color: #43749e; // Candidate for style guide
    				}
    			}
    
    			&-purple {
    				&:after {
    					color: #2200b7; // Candidate for style guide
    				}
    			}
    			&-green {
    				&:after {
    					color: #2cbcb2; // Candidate for style guide
    				}
    			}
    			&-red {
    				&:after {
    					color: #ff5a5a; // Candidate for style guide
    				}
    			}
    			&-blue {
    				&:after {
    					color: $blue;
    				}
    			}
    			&-white {
    				&:after {
    					color: #fff;
    				}
    			}
    			&-black {
    				&:after {
    					color: #000;
    				}
    			}
    		}
    
    		&--handle-background-on {
    			&-orange {
    				&:after {
    					border-color: $orange;
    					background-color: $orange;
    				}
    			}
    
    			&-dark-blue {
    				&:after {
    					border-color: #43749e; // Candidate for style guide
    					background-color: #43749e; // Candidate for style guide
    				}
    			}
    
    			&-purple {
    				&:after {
    					border-color: #2200b7; // Candidate for style guide
    					background-color: #2200b7; // Candidate for style guide
    				}
    			}
    			&-green {
    				&:after {
    					border-color: #2cbcb2; // Candidate for style guide
    					background-color: #2cbcb2; // Candidate for style guide
    				}
    			}
    			&-red {
    				&:after {
    					border-color: #ff5a5a; // Candidate for style guide
    					background-color: #ff5a5a; // Candidate for style guide
    				}
    			}
    			&-blue {
    				&:after {
    					border-color: $blue;
    					background-color: $blue;
    				}
    			}
    			&-white {
    				&:after {
    					border-color: #fff;
    					background-color: #fff;
    				}
    			}
    			&-black {
    				&:after {
    					border-color: #000;
    					background-color: #000;
    				}
    			}
    		}
    
    		&--track-background-on {
    			&-orange {
    				background-color: $orange;
    			}
    
    			&-dark-blue {
    				background-color: #43749e; // Candidate for style guide
    			}
    
    			&-purple {
    				background-color: #2200b7; // Candidate for style guide
    			}
    			&-green {
    				background-color: #2cbcb2; // Candidate for style guide
    			}
    			&-red {
    				background-color: #ff5a5a; // Candidate for style guide
    			}
    			&-blue {
    				background-color: $blue;
    			}
    			&-white {
    				background-color: #fff;
    			}
    			&-black {
    				background-color: #fff;
    			}
    		}
    	}
    
    	&:checked + .acl-toggle__icon-label--small:after {
    		font-size: 9px;
    		line-height: 1.6;
    	}
    
    	&:checked + .acl-toggle__icon-label--medium:after {
    		font-size: 12px;
    		line-height: 1.6;
    	}
    
    	&:active:after {
    		width: 40px;
    	}
    
    	&__label {
    		cursor: pointer;
    		text-indent: -9999px;
    		width: 40px;
    		height: 20px;
    		background: #fff;
    		display: block;
    		border-radius: 100px;
    		position: relative;
    		box-shadow: inset 0 2px 3px 0 rgba(0, 0, 0, 0.2);
    
    		&--flat {
    			box-shadow: none;
    
    			&:after {
    				content: '';
    				position: absolute;
    				top: 0;
    				left: 0;
    				width: 21px;
    				height: 21px;
    				border-radius: 21px;
    				transition: 0.3s;
    				border: 1px solid $white;
    				background-color: #e8ebf8;
    				box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    			}
    		}
    
    		&:after {
    			content: '';
    			position: absolute;
    			top: -2px;
    			left: -2px;
    			width: 21px;
    			height: 21px;
    			border-radius: 21px;
    			transition: 0.3s;
    			border: 1px solid #cacfe2;
    			background-color: #e8ebf8;
    			box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    		}
    
    		&--extra-small {
    			width: 16px;
    			height: 10px;
    
    			&:after {
    				width: 8px;
    				height: 8px;
    			}
    		}
    
    		&--small {
    			width: 22px;
    			height: 11px;
    
    			&:after {
    				width: 12px;
    				height: 12px;
    			}
    		}
    
    		&--medium {
    			width: 30px;
    			height: 15px;
    
    			&:after {
    				width: 16px;
    				height: 16px;
    			}
    		}
    	}
    
    	&__icon-label {
    		cursor: pointer;
    		width: 40px;
    		height: 20px;
    		background: #f7f6fb;
    		display: block;
    		border-radius: 100px;
    		position: relative;
    		box-shadow: inset 0 2px 3px 0 rgba(0, 0, 0, 0.2);
    
    		&:after {
    			font-family: 'Aforza-icon-font';
    			content: attr(data-unchecked-icon);
    			position: absolute;
    			color: #ff5a5a;
    			line-height: 1;
    			font-size: 21px;
    			text-align: center;
    			justify-content: center;
    			align-items: center;
    			display: flex;
    			top: -2px;
    			left: -2px;
    			width: 21px;
    			height: 21px;
    			background: #ffe7e7;
    			border-radius: 21px;
    			transition: 0.2s;
    			border: 1px solid #cacfe2;
    			background-color: #e8ebf8;
    			box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    		}
    
    		&--track-background {
    			&-orange {
    				background-color: $orange;
    			}
    
    			&-dark-blue {
    				background-color: #43749e; // Candidate for style guide
    			}
    
    			&-purple {
    				background-color: #2200b7; // Candidate for style guide
    			}
    			&-green {
    				background-color: #2cbcb2; // Candidate for style guide
    			}
    			&-red {
    				background-color: #ff5a5a; // Candidate for style guide
    			}
    			&-blue {
    				background-color: $blue;
    			}
    			&-white {
    				background-color: #fff; // Candidate for style guide
    			}
    			&-black {
    				background-color: #000;
    			}
    		}
    
    		&--icon-off {
    			&-orange {
    				&:after {
    					color: $orange;
    				}
    			}
    
    			&-dark-blue {
    				&:after {
    					color: #43749e; // Candidate for style guide
    				}
    			}
    
    			&-purple {
    				&:after {
    					color: #2200b7; // Candidate for style guide
    				}
    			}
    			&-green {
    				&:after {
    					color: #2cbcb2; // Candidate for style guide
    				}
    			}
    			&-red {
    				&:after {
    					color: #ff5a5a; // Candidate for style guide
    				}
    			}
    			&-blue {
    				&:after {
    					color: $blue;
    				}
    			}
    			&-white {
    				&:after {
    					color: #fff; // Candidate for style guide
    				}
    			}
    			&-black {
    				&:after {
    					color: #000;
    				}
    			}
    		}
    
    		&--handle-background-off {
    			&-orange {
    				&:after {
    					border-color: $orange;
    					background-color: $orange;
    				}
    			}
    
    			&-dark-blue {
    				&:after {
    					border-color: #43749e; // Candidate for style guide
    					background-color: #43749e; // Candidate for style guide
    				}
    			}
    
    			&-purple {
    				&:after {
    					border-color: #2200b7; // Candidate for style guide
    					background-color: #2200b7; // Candidate for style guide
    				}
    			}
    			&-green {
    				&:after {
    					border-color: #2cbcb2; // Candidate for style guide
    					background-color: #2cbcb2; // Candidate for style guide
    				}
    			}
    			&-red {
    				&:after {
    					border-color: #ff5a5a; // Candidate for style guide
    					background-color: #ff5a5a; // Candidate for style guide
    				}
    			}
    			&-blue {
    				&:after {
    					border-color: $blue;
    					background-color: $blue;
    				}
    			}
    			&-white {
    				&:after {
    					border-color: #fff;
    					background-color: #fff; // Candidate for style guide
    				}
    			}
    			&-black {
    				&:after {
    					border-color: #000;
    					background-color: #000;
    				}
    			}
    		}
    
    		&--extra-small {
    			width: 16px;
    			height: 10px;
    
    			&:after {
    				width: 8px;
    				height: 8px;
    			}
    		}
    
    		&--small {
    			width: 22px;
    			height: 11px;
    
    			&:after {
    				width: 12px;
    				height: 12px;
    				line-height: 1;
    				font-size: 12px;
    			}
    		}
    
    		&--medium {
    			width: 30px;
    			height: 15px;
    
    			&:after {
    				width: 16px;
    				height: 16px;
    				line-height: 1.05;
    				font-size: 16px;
    			}
    		}
    	}
    
    	&--flat {
    		height: 0;
    		width: 0;
    		display: none;
    
    		&:checked + .acl-toggle--flat__label:after {
    			left: calc(100% - 1px);
    			transform: translateX(-100%);
    			background-color: #2cbcb2; //Candidate for stylesheet.
    		}
    
    		&:active:after {
    			width: 40px;
    		}
    
    		&__label {
    			cursor: pointer;
    			text-indent: -9999px;
    			width: 40px;
    			height: 20px;
    			background: $white;
    			display: block;
    			border-radius: 100px;
    			position: relative;
    
    			&:after {
    				content: '';
    				position: absolute;
    				top: 1px;
    				left: 1px;
    				width: 18px;
    				height: 18px;
    				border-radius: 21px;
    				transition: 0.3s;
    				background-color: #d5d5d5; //Candidate for stylesheet.
    			}
    
    			&--extra-small {
    				width: 16px;
    				height: 10px;
    
    				&:after {
    					width: 8px;
    					height: 8px;
    				}
    			}
    
    			&--small {
    				width: 22px;
    				height: 11px;
    
    				&:after {
    					width: 9px;
    					height: 9px;
    				}
    			}
    
    			&--medium {
    				width: 30px;
    				height: 15px;
    
    				&:after {
    					width: 13px;
    					height: 13px;
    				}
    			}
    		}
    	}
    }
    
  • URL: /components/raw/toggle/acl-toggle.scss
  • Filesystem Path: src/components/toggle/acl-toggle.scss
  • Size: 8.7 KB

No notes defined.