add umb-badge component

This commit is contained in:
Mads Rasmussen
2017-05-04 11:29:36 +02:00
parent e327a971c2
commit 7001e791f7
4 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
(function() {
'use strict';
function BadgeDirective() {
var directive = {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: 'views/components/umb-badge.html',
scope: {
size: "@?",
color: "@?"
}
};
return directive;
}
angular.module('umbraco.directives').directive('umbBadge', BadgeDirective);
})();

View File

@@ -120,6 +120,7 @@
@import "components/umb-querybuilder.less";
@import "components/umb-pagination.less";
@import "components/umb-mini-list-view.less";
@import "components/umb-badge.less";
@import "components/buttons/umb-button.less";
@import "components/buttons/umb-button-group.less";

View File

@@ -0,0 +1,65 @@
.umb-badge {
padding: 6px 8px;
margin: 0 5px 0 0;
font-weight: 600;
color: @black;
background-color: @turquoise-washed;
border-width: 1px;
border-style: solid;
border-color: @turquoise;
display: inline-flex;
align-items: center;
justify-content: center;
}
// Colors
.umb-badge--primary {
background-color: @turquoise-washed;
border-color: @turquoise;
}
.umb-badge--seconday {
background-color: @purple-washed;
border-color: @purple;
}
.umb-badge--danger {
background-color: @red-washed;
border-color: @red;
}
.umb-badge--warning {
background-color: @yellow-washed;
border-color: @yellow;
}
.umb-badge--success {
background-color: @green-washed;
border-color: @green;
}
// Size
.umb-badge--xs {
font-size: 13px;
padding: 1px 6px;
}
.umb-badge--s {
font-size: 14px;
padding: 3px 6px;
}
.umb-badge--m {
font-size: 16px;
padding: 6px 8px;
}
.umb-badge--l {
font-size: 18px;
padding: 6px 8px;
}
.umb-badge--xl {
font-size: 20px;
padding: 6px 8px;
}

View File

@@ -0,0 +1 @@
<span class="umb-badge umb-badge--{{color}} umb-badge--{{size}}" ng-transclude></span>