Skip to content

Commit

Permalink
feat: add spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Renato Moor committed Aug 27, 2022
1 parent 2e5f92b commit 4bd99e4
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/components/ColorsFoundation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const getRootColors = () => {
rootColors[key] = props.colors[key]
}
}
console.log(rootColors)
return rootColors
}
Expand All @@ -38,7 +37,7 @@ const getRootColors = () => {
</template>


<style>
<style scoped>
.colors-padding {
margin-left: auto;
margin-right: auto;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ColorsGrid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function hexToRgb(hex) {
</template>


<style>
<style scoped>
h2 {
font-size: 1.5rem;
font-weight: bold;
Expand Down
43 changes: 43 additions & 0 deletions src/components/SpacesFoundation.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script setup>
const props = defineProps({
spaces: {
type: Object,
required: true
}
})
</script>


<template>
<h2 class="title">
Spaces
</h2>
<div class="spaces">
<div v-for="(space, key) in spaces">
<div class="spaces__space" :style="`width: ${space}`"/>
<div>{{ key }}</div>
</div>
</div>
</template>


<style scoped>
.title {
text-align: center;
}
.spaces {
padding: 5rem;
margin-left: auto;
margin-right: auto;
display: grid;
grid-template-columns: repeat(3, 1fr);
}
.spaces__space {
border-radius: 0.75rem;
background-color: gray;
margin-bottom: 1rem;
height: 5rem;
}
</style>
19 changes: 19 additions & 0 deletions src/stories/Spaces.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import SpacesFoundation from '../components/SpacesFoundation.vue';

export default {
title: 'Foundations/Spaces',
component: SpacesFoundation,
};

const Template = (args) => ({
components: { SpacesFoundation },
setup() {
return { args };
},
template: '<SpacesFoundation v-bind="args" />',
});

export const Spaces = Template.bind({});
Spaces.args = {
spaces: import.meta.env.STORYBOOK_TAILWIND.theme.space,
}
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
],
theme: {
extend: {

'test': 'rgba(1, 1, 1, 0.1)',
},
},
plugins: [],
Expand Down

0 comments on commit 4bd99e4

Please sign in to comment.