Badge Selector

No notes defined.

<!-- Default -->
<span class="sds-badgeSelector">

    <span class="sds-icon sds-icon-star"></span>

</span>

<!-- Selected -->
<span class="sds-badgeSelector -isSelected">

    <span class="sds-icon sds-icon-star"></span>

</span>

<!-- Disabled -->
<span class="sds-badgeSelector -isDisabled">

    <span class="sds-icon sds-icon-star"></span>

</span>

<!-- Large -->
<span class="sds-badgeSelector -large">

    <span class="sds-icon sds-icon-star"></span>

</span>

<!-- Cta -->
<span class="sds-badgeSelector -cta">

    <span class="sds-icon sds-icon-star"></span>

</span>

<!-- Text -->
<span class="sds-badgeSelector">

    <span class="sds-badgeSelector__text">text</span>

</span>

<!-- Color Option -->
<span class="sds-badgeSelector -colorOption">

    <span class="sds-colorOption" style="background-color: #000000"></span>

    <span class="sds-badgeSelector__text">color</span>

</span>

<!-- Color Option Label Hidden -->
<span class="sds-badgeSelector -colorOption -labelHiddenMobile">

    <span class="sds-colorOption" style="background-color: #000000"></span>

    <span class="sds-badgeSelector__text">color</span>

</span>

<{{ eltType }}
{% if eltType === "button" %} type="button"{%- endif -%} class="{{ namespace }}badgeSelector{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}"{% for attrKey, attr in attrs %} {{ attrKey }}="{{ attr }}"{% endfor %}>
	{% if colorOption %}
		{% render "@color-option",{
			background: colorOption
		},true %}
	{% endif %}
	{% if svg %}
		<img src="{{ (mediaPath + "/snet/components/recaptcha/" + svg + ".svg" ) | path }}" alt="">
	{% elseif text %}
		<span class="{{ namespace }}badgeSelector__text">{{ text }}</span>
	{% elseif icon %}
		<span class="{{ namespace }}icon {{ namespace }}{{ icon }}"></span>
	{% endif %}
</{{ eltType }}>
  • Content:
    /* variables specific to current element */
    
    $element-specific-variables: "";
    
    .#{$namespace}badgeSelector {
    
    	/* Save root element context for easy access if nesting is needed */
    
    	$self: &;
    
    	/* properties of current element  + media queries */
    	@include custom-prop-fallback("background-color", "comp-button-secondary-background-color");
    	@include custom-prop-fallback("color", "sys-color-text-primary-muted");
    	border-radius: map-deep-get($token-radius-map, "16");
    	display: inline-flex;
    	align-items: center;
    	justify-content: center;
    	min-width: map-deep-get($token-sizes-unit-map, "48");
    	min-height: $badge-selector-height-global;
    	padding: map-deep-get($token-spacer-inset-map, "sm");
    	gap: map-deep-get($token-spacer-inline-map, "sm");
    	border: $border-width*2 solid transparent;
    
    	/* Pseudo Elements */
    
    	&::before {
    	}
    
    	&::after {
    	}
    
    	/*
    	Include elements that are linked to the current element but have to reside at the root level of the stylesheet
    	(e.g: keyframes)
    	*/
    	@at-root {
    	}
    
    
    	/* children - write selector in full in comments in order to facilitate search */
    
    	// badgeSelector__text
    	&__text {
    
    		// follows same logic as parent
    		font-weight: map-deep-get($token-font-weight-map, "semi-bold");
    	}
    
    	&[aria-pressed="true"] {
    
    		@include custom-prop-fallback("border-color", "sys-color-text-primary-vivid","true","true");
    		@include custom-prop-fallback("color", "sys-color-text-primary-vivid");
    
    	}
    
    
    	/* modifiers */
    
    	// badgeSelector -isSelected
    	&.-isSelected {
    
    		// follows same logic as base element
    
    		@include custom-prop-fallback("border-color", "sys-color-text-primary-vivid","true","true");
    		@include custom-prop-fallback("color", "sys-color-text-primary-vivid");
    
    	}
    
    	&.-large {
    
    		width: auto;
    		height: auto;
    		padding: 1em;
    		border-radius: map-deep-get($token-radius-map, "24");
    
    		[class*="icon"] {
    
    			&::before {
    
    				@extend %textBodyXxl;
    				line-height: 1;
    
    			}
    
    		}
    
    		#{$self}__text {
    
    			text-align: center;
    			font-weight: map-deep-get($token-font-weight-map, "bold");
    
    		}
    
    		&.-hasText {
    
    			padding: 0.9915em 1.38125em;
    			@extend %textBodyXl;
    
    		}
    
    	}
    
    	&.-hasText {
    
    		padding: 0.5em 1.5em;
    
    	}
    
    	&.-cta {
    
    		@include custom-prop-fallback("background-color", "comp-button-secondary-inverse-background-color");
    		@include custom-prop-fallback("color", "comp-button-secondary-text-color");
    
    		&:hover,
    		&:focus {
    			@media (hover: hover) {
    				@include custom-prop-fallback("background-color", "comp-button-secondary-hovered-background-color", true, true);
    			}
    		}
    
    	}
    	
    	&.-colorOption {
    
    		padding-right: $input-padding-x*2;
    
    		&.-labelHiddenMobile {
    
    			@include media-breakpoint-between("xs","sm") {
    
    				padding-right: map-deep-get($token-spacer-inset-map, "sm");
    
    				#{$self}__text {
    					display: none;
    				}
    
    			}
    
    		}
    
    	}
    
    	&.-isDisabled,
    	[disabled] + & {
    		@include custom-prop-fallback("color", "comp-button-secondary-disabled-text-color","true","true");
    	}
    
    	/* random parent element */
    	/*
    	*
    	*   Syntax : .randomParentElt & {}
    	*
    	*/
    
    	/* Pseudo Classes */
    
    	&:hover,
    	&:focus {
    		@media (hover: hover) {
    			@include custom-prop-fallback("background-color", "comp-button-secondary-hovered-background-color", true, true);
    		}
    	}
    
    	&:focus {
    	}
    
    	&:active {
    	}
    
    	&:focus,
    	&:active {
    	}
    
    }
  • URL: /components/raw/badge-selector/_badge-selector.scss
  • Filesystem Path: components/base-components/atoms/badges/badge-selector/_badge-selector.scss
  • Size: 3.3 KB