Badge

No notes defined.

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

    badge

</span>

<!-- Primary -->
<span class="sds-badge badge -badgePrimary">

    badge

</span>

<!-- Primary Large -->
<span class="sds-badge badge -badgePrimary -badgeLg">

    badge

</span>

<!-- Primary Small -->
<span class="sds-badge badge -badgePrimary -badgeSm">

    badge

</span>

<!-- Primary Icon -->
<span class="sds-badge badge -badgePrimary -badgeLg">

    <span class="sds-icon sds-icon-check" aria-hidden="true"></span>

    badge

</span>

<!-- Primary Muted -->
<span class="sds-badge badge -badgePrimary -badgeMuted">

    badge

</span>

<!-- Primary Muted Icon -->
<span class="sds-badge badge -badgePrimary -badgeMuted -badgeLg">

    <span class="sds-icon sds-icon-check" aria-hidden="true"></span>

    badge

</span>

<!-- Primary Tonal -->
<span class="sds-badge badge -badgePrimary -badgeTonal">

    badge

</span>

<!-- Highlight -->
<span class="sds-badge badge -badgeHighlight">

    badge

</span>

<!-- Highlight Muted -->
<span class="sds-badge badge -badgeHighlight -badgeMuted">

    badge

</span>

<!-- Highlight Muted Small -->
<span class="sds-badge badge -badgeHighlight -badgeMuted -badgeSm">

    badge

</span>

<!-- Success -->
<span class="sds-badge badge -badgeSuccess">

    badge

</span>

<!-- Success Muted -->
<span class="sds-badge badge -badgeSuccess -badgeMuted">

    badge

</span>

<!-- Danger -->
<span class="sds-badge badge -badgeDanger">

    badge

</span>

<!-- Danger Muted -->
<span class="sds-badge badge -badgeDanger -badgeMuted">

    badge

</span>

<!-- Warning -->
<span class="sds-badge badge -badgeWarning">

    badge

</span>

<!-- Warning Muted -->
<span class="sds-badge badge -badgeWarning -badgeMuted">

    badge

</span>

<!-- Info -->
<span class="sds-badge badge -badgeInfo">

    badge

</span>

<!-- Info Muted -->
<span class="sds-badge badge -badgeInfo -badgeMuted">

    badge

</span>

<!-- Neutral -->
<span class="sds-badge badge -badgeNeutral">

    badge

</span>

<!-- Neutral Muted -->
<span class="sds-badge badge -badgeNeutral -badgeMuted">

    badge

</span>

<!-- Success 10 Icon -->
<span class="sds-badge badge -success10 -stock">

    <span class="sds-icon sds-icon-arrowhigher" aria-hidden="true"></span>

    badge

</span>

<!-- Primary 10 Icon -->
<span class="sds-badge badge -primary10 -stock">

    <span class="sds-icon sds-icon-arrowlower" aria-hidden="true"></span>

    badge

</span>

{% include "@badge-frame" %}
  • Content:
    /* variables specific to current element */
    
    $element-specific-variables: "";
    
    .#{$namespace}badge {
    
    	/* Save root element context for easy access if nesting is needed */
    
    	$self: &;
    
    
    	/* properties of current element  + media queries */
    	@include custom-prop-fallback("gap","comp-badge-inline");
    
    	/* 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 */
    
    	// badge__childElement
    	[class*="icon"] {
    
    		&::before {
    
    			@include custom-prop-fallback("font-size", "comp-badge-large-icon-size");
    
    		}
    
    	}
    
    
    	/* modifiers */
    
    	// badge -info10
    	&.-badgePrimary {
    
    		@include custom-prop-fallback("background-color", "comp-badge-primary-background-color");
    		@include custom-prop-fallback("color", "comp-badge-primary-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-primary-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-primary-muted-text-color");
    
    		}
    
    		&.-badgeTonal {
    
    			@include custom-prop-fallback("background-color", "comp-badge-primary-tonal-background-color");
    			@include custom-prop-fallback("color", "comp-badge-primary-text-color");
    
    		}
    
    	}
    	&.-badgeHighlight {
    
    		@include custom-prop-fallback("background-color", "comp-badge-highlight-background-color");
    		@include custom-prop-fallback("color", "comp-badge-highlight-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-highlight-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-highlight-muted-text-color");
    
    		}
    
    	}
    	&.-badgeSuccess {
    
    		@include custom-prop-fallback("background-color", "comp-badge-success-background-color");
    		@include custom-prop-fallback("color", "comp-badge-success-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-success-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-success-muted-text-color");
    
    		}
    
    	}
    	&.-badgeDanger {
    
    		@include custom-prop-fallback("background-color", "comp-badge-danger-background-color");
    		@include custom-prop-fallback("color", "comp-badge-danger-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-danger-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-danger-muted-text-color");
    
    		}
    
    	}
    	&.-badgeWarning {
    
    		@include custom-prop-fallback("background-color", "comp-badge-warning-background-color");
    		@include custom-prop-fallback("color", "comp-badge-warning-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-warning-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-warning-muted-text-color");
    
    		}
    
    	}
    	&.-badgeInfo {
    
    		@include custom-prop-fallback("background-color", "comp-badge-info-background-color");
    		@include custom-prop-fallback("color", "comp-badge-info-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-info-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-info-muted-text-color");
    
    		}
    
    	}
    	&.-badgeNeutral {
    
    		@include custom-prop-fallback("background-color", "comp-badge-neutral-background-color");
    		@include custom-prop-fallback("color", "comp-badge-neutral-text-color");
    
    		&.-badgeMuted {
    
    			@include custom-prop-fallback("background-color", "comp-badge-neutral-muted-background-color");
    			@include custom-prop-fallback("color", "comp-badge-neutral-muted-text-color");
    
    		}
    
    	}
    	&.-info10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-info-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-info-muted-text-color");
    
    	}
    
    	&.-warning10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-warning-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-warning-muted-text-color");
    
    	}
    
    	// badge -fade120
    	&.-fade10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-neutral-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-neutral-muted-text-color");
    
    	}
    
    	// badge -success100
    	&.-success10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-success-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-success-muted-text-color");
    
    	}
    
    	// badge -fade100
    	// @TODO badge BG got changed, class name will have to be adapted at some point
    	&.-fade100 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-primary-tonal-background-color");
    		@include custom-prop-fallback("color", "comp-badge-primary-text-color");
    
    	}
    
    	&.-primary10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-danger-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-danger-muted-text-color");
    
    	}
    
    	&.-secondary10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-primary-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-primary-muted-text-color");
    	}
    
    	&.-highlight10 {
    
    		@include custom-prop-fallback("background-color", "comp-badge-highlight-muted-background-color");
    		@include custom-prop-fallback("color", "comp-badge-highlight-muted-text-color");
    
    	}
    
    	&.-primary100 {
    
    		@include custom-prop-fallback("background-color", "sys-color-background-secondary-100");
    		@include custom-prop-fallback("color", "sys-color-text-neutral-inverse");
    		@include custom-prop-fallback("background-image", "sys-color-background-secondary-gradient");
    
    	}
    
    	&.-primary100Bg {
    
    		@include custom-prop-fallback("background-color", "comp-badge-danger-background-color");
    		@include custom-prop-fallback("color", "comp-badge-danger-text-color");
    
    	}
    
    	&.-success100Bg {
    
    		@include custom-prop-fallback("background-color", "comp-badge-success-background-color");
    		@include custom-prop-fallback("color", "comp-badge-success-text-color");
    
    	}
    
    	&.-badgeSmall,
    	&.-badgeSm,
    	&.-small {
    
    		@extend %textHelperSmall;
    		@include custom-prop-fallback("height", "comp-badge-small-height");
    		@include custom-prop-fallback("padding-left", "comp-badge-small-inset-h");
    		@include custom-prop-fallback("padding-right", "comp-badge-small-inset-h");
    		@include custom-prop-fallback("border-radius", "comp-badge-small-border-radius");
    		@extend %textBold;
    
    	}
    
    	&.-badgeLarge,
    	&.-badgeLg,
    	&.-large {
    
    		@extend %textBodyLg;
    		@include custom-prop-fallback("height", "comp-badge-large-height");
    		@include custom-prop-fallback("padding-left", "comp-badge-large-inset-h");
    		@include custom-prop-fallback("padding-right", "comp-badge-large-inset-h");
    		@include custom-prop-fallback("border-radius", "comp-badge-large-border-radius");
    		@include custom-prop-fallback("gap", "comp-badge-large-inline");
    
    	}
    	
    	&.-stock {
    
    		position: relative;
    		padding-top: map-deep-get($token-spacer-unit-map, "8");
    		padding-bottom: map-deep-get($token-spacer-unit-map, "8");
    		//padding-left: map-deep-get($token-spacer-unit-map, "24");
    		line-height: 1.145;
    		height: auto;
    
    		/* @TODO rewrite this shite sometime soon */
    		.#{$namespace}icon {
    
    			height: 0;
    			position: relative;
    			left: -9px;
    			margin-right: -7px;
    			top: 50%;
    			transform: translateY(-50%);
    
    			&::before {
    
    				display: block;
    				margin-top: -14px;
    
    			}
    
    		}
    		
    	}
    	
    	&.-badgeBlock {
    
    		justify-content: center;
    		width: 100%;
    
    	}
    
    	&.-badgeIcon {
    
    		@include custom-prop-fallback("border-radius","comp-badge-status-icon-only-border-radius")
    
    	}
    
    	/* random parent element */
    	/*
    	*
    	*   Syntax : .randomParentElt & {}
    	*
    	*/
    
    	/* Pseudo Classes */
    
    	&:hover {
    		@media (hover: hover) {
    
    		}
    	}
    
    	&:focus {
    	}
    
    	&:active {
    	}
    
    	&:focus,
    	&:active {
    	}
    
    }
  • URL: /components/raw/badge/_badge.scss
  • Filesystem Path: components/base-components/atoms/badges/badge/_badge.scss
  • Size: 7.9 KB