Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 62 additions & 5 deletions docs-src/components/StyleExamples/KsStyleButtons.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<hr>
<div class="sm-12">
<button class="ks-button none disabled">
I'm a default button
I'm a disabled button
</button>
<a href="#" class="ks-button none tiny">
I'm a tiny button
Expand All @@ -103,7 +103,7 @@
<code-block class="mt-2">
<template v-pre>
&lt;button class="ks-button none disabled">
I'm a default button
I'm a disabled button
&lt;/button>
&lt;a href="#" class="ks-button none tiny">
I'm a tiny button
Expand All @@ -116,16 +116,73 @@
&lt;/a>
</template>
</code-block>
<div>
<table class="ks-table striped shadow">
<thead>
<tr>
<th>Class</th>
<th>Hover Class</th>
<th>Value</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<template v-for="color in colors">
<template v-if="typeof color.colors === 'string'">
<tr>
<td><code>.bg-{{color.name}} (.text-red-500)</code></td>
<td></td>
<td><code>{{color.colors}}</code></td>
<td>
<button :class="`ks-button bg-${color.name} text-red-500`">{{color.name}}</button>
</td>
</tr>
</template>
<template v-else v-for="(hex, weight) in color.colors">
<tr>
<td>
<code>.bg-{{color.name}}-{{weight}}</code>
</td>
<td>
<code>.hover:bg-{{color.name}}-{{getHoverWeight(weight)}}</code>
</td>
<td><code>{{hex}}</code></td>
<td>
<button :class="`ks-button bg-${color.name}-${weight} hover:bg-${color.name}-${getHoverWeight(weight)}`">
bg-{{color.name}}-{{weight}}
</button>
</td>
</tr>
</template>
</template>
</tbody>

</table>
</div>
</div>
</div>
</template>

<script>
// External Dependencies

// Internal Dependencies
import colors from '../../content/style-maps/colors.json';

export default {
name: 'Buttons',

data() {
return {
colors: colors.colors,
}
},

methods: {
getHoverWeight(weight) {
if ( weight === '900' ) {
return parseInt(weight) - 100;
}

return parseInt(weight) + 100;
}
}
}
</script>
2 changes: 1 addition & 1 deletion src/styles/components/_buttons.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
box-shadow: $button-box-shadow;
}

&:hover:not(.disabled) {
&:hover {
@include state-hover;
}

Expand Down