update cartoassets with buttons and colors

This commit is contained in:
piensaenpixel 2017-05-09 18:17:30 +02:00
parent 0044cebbd9
commit 8060bfe0b2
3 changed files with 98 additions and 10 deletions

View File

@ -9,8 +9,13 @@ Layout Component:
```
<button class="CDB-Button CDB-Button--primary CDB-Button--big">
<button class="CDB-Button CDB-Button--loading CDB-Button--primary CDB-Button--big">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-medium">SAVE</span>
<div class="CDB-Button-loader CDB-LoaderIcon is-white">
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
</svg>
</div>
</button>
<button class="CDB-Button CDB-Button--primary CDB-Button--big is-disabled">
@ -18,16 +23,26 @@ Layout Component:
</button>
<button class="CDB-Button CDB-Button--primary">
<button class="CDB-Button CDB-Button--loading CDB-Button--primary">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small">SAVE</span>
<div class="CDB-Button-loader CDB-LoaderIcon is-white">
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
</svg>
</div>
</button>
<button class="CDB-Button CDB-Button--primary is-disabled">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small">SAVE</span>
</button>
<button class="CDB-Button CDB-Button--primary CDB-Button--small">
<button class="CDB-Button CDB-Button--loading CDB-Button--primary CDB-Button--small">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small">SAVE</span>
<div class="CDB-Button-loader CDB-LoaderIcon CDB-LoaderIcon--small is-white">
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
</svg>
</div>
</button>
<button class="CDB-Button CDB-Button--primary CDB-Button--small is-disabled">
@ -151,12 +166,14 @@ Layout Component:
.CDB-Button {
@include transition(background, 300ms);
padding: $baseSize + 1 $baseSize + 12;
position: relative;
padding: $baseSize $baseSize + 12;
border: 1px solid transparent;
border-radius: $baseSize / 2;
cursor: pointer;
box-sizing: border-box;
.CDB-Button-Text {
display: block;
}
@ -166,12 +183,51 @@ Layout Component:
}
}
.CDB-Button--loading {
.CDB-Button-loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0);
transform-origin: 50%;
opacity: 0;
z-index: 10;
}
.CDB-Button-Text {
@include transition(all 600ms);
}
&.is-loading {
.CDB-Button-loader {
animation-name: showIn;
animation-duration: 600ms;
animation-fill-mode: forwards;
}
.CDB-Button-Text {
opacity: 0;
}
}
}
@keyframes showIn {
0% {
transform: translate(-50%, -50%) scale(0);
opacity: 0;
}
100% {
transform: translate(-50%, -50%) scale(1);
opacity: 1;
}
}
.CDB-Button--small {
padding: $baseSize / 2 $baseSize + 4;
border-radius: 3px;
}
.CDB-Button--big {
padding: $baseSize + 4 $baseSize + 12;
padding: $baseSize + 3 $baseSize + 12;
}
.CDB-Button--icon {
@ -252,24 +308,44 @@ Layout Component:
# Buttons/Secondary
```
<button class="CDB-Button CDB-Button--secondary CDB-Button--big">
<button class="CDB-Button CDB-Button--loading CDB-Button--secondary CDB-Button--big">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-medium">SAVE</span>
<div class="CDB-Button-loader CDB-LoaderIcon is-blue">
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
</svg>
</div>
</button>
<button class="CDB-Button CDB-Button--secondary CDB-Button--big is-disabled">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-medium">SAVE</span>
</button>
<button class="CDB-Button CDB-Button--secondary">
<button class="CDB-Button CDB-Button--loading CDB-Button--secondary">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-medium">SAVE</span>
<div class="CDB-Button-loader CDB-LoaderIcon is-blue">
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
</svg>
</div>
</button>
<button class="CDB-Button CDB-Button--secondary is-disabled">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-medium">SAVE</span>
</button>
<button class="CDB-Button CDB-Button--secondary CDB-Button--small">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-small">SAVE</span>
<button class="CDB-Button CDB-Button--loading CDB-Button--secondary CDB-Button--small">
<span class="CDB-Button-Text CDB-Text is-semibold CDB-Size-medium">SAVE</span>
<div class="CDB-Button-loader CDB-LoaderIcon CDB-LoaderIcon--small is-blue">
<svg class="CDB-LoaderIcon-spinner" viewbox="0 0 50 50">
<circle class="CDB-LoaderIcon-path" cx="25" cy="25" r="20" fill="none"/>
</svg>
</div>
</button>
<button class="CDB-Button CDB-Button--secondary CDB-Button--small is-disabled">

View File

@ -15,7 +15,7 @@ $cThirdBackground: #F9F9F9;
//Lines
$cHoverLine: #AAA;
$cMainLine: #DDD;
$cSecondaryLine: #EEE;
$cSecondaryLine: rgba($cMainBg, 0.08);
//Typography
$cMainText: #2E3C43;

View File

@ -1,5 +1,8 @@
<head>
<link href='../css/cartostyles.css' type='text/css' rel='stylesheet'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
{{> theme}}
@ -44,6 +47,12 @@
// Show section in Styleguide
j('#styleguide .section[data-section="' + j('#styleguide-menu a').first().data('section') + '"]').show();
}
$('.CDB-Button--loading').click(function(){
console.log($(this));
$(this).toggleClass("is-loading");
})
});
</script>
@ -116,3 +125,6 @@
</div>
{{/each}}
</div>