feat: nicer styling of repositories and repositories lists
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Lucien Cartier-Tilet 2023-05-08 03:35:28 +02:00
parent de2f11f8fe
commit fea30d5bea
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA
3 changed files with 55 additions and 15 deletions

View File

@ -1,14 +1,18 @@
<template>
<div class="githubRepo flex-col rounded-corners">
<h4>{{ props.repo.name }}</h4>
<div class="flex-row space-between">
<p>{{ props.repo.description }}</p>
<div class="gap-1rem flex-end">
<div class="githubRepo flex-row flex-space-between gap-1rem rounded-corners">
<div class="flex-col info">
<h3>{{ props.repo.name }}</h3>
<div>
<p>
{{ props.repo.description }}
</p>
</div>
</div>
<div class="flex-col flex-start gap-1rem stats">
<p>Stars: {{ repo.stargazers_count }}</p>
<p>Forks: {{ repo.forks_count }}</p>
</div>
</div>
</div>
</template>
<script setup lang="ts">
@ -24,8 +28,20 @@ const props = defineProps({
@import '../../styles/classes.less';
.githubRepo {
max-width: 35rem;
width: 35rem;
padding: 3rem;
background-color: @nord4;
html.dark & {
background-color: @nord3;
}
.info {
max-width: 30rem;
}
.stats {
width: 4rem;
}
}
</style>

View File

@ -1,6 +1,13 @@
<template>
<ApiLoader :url="fetchUrl" @dataLoaded="filterRepos">
<GithubRepository :repo="repo" type="repositories" v-for="repo in repos" />
<div class="flex-col gap-1rem list-repos">
<GithubRepository
:repo="repo"
type="repositories"
v-for="repo in repos"
class="center"
/>
</div>
</ApiLoader>
</template>
@ -47,4 +54,10 @@ const filterRepos = (response: GithubRepo[]) => {
};
</script>
<style lang="less"></style>
<style lang="less">
@import '../../styles/classes.less';
.list-repos {
margin: 2rem auto;
}
</style>

View File

@ -18,15 +18,26 @@ each(range(5), {
flex-direction: row;
}
@flex-justifications: flex-start, flex-end, center, space-between, space-around,
space-evenly;
each(@flex-justifications, {
@flex-justifications-prefixed: flex-start, flex-end;
each(@flex-justifications-prefixed, {
.@{value} {
.flex();
justify-content: @value;
}
});
.rounded-corners {
border-radius: 1rem;
@flex-justifications: center, space-between, space-around, space-evenly;
each(@flex-justifications, {
.flex-@{value} {
.flex();
justify-content: @value;
}
});
.rounded-corners {
border-radius: 0.3rem;
}
.center {
margin: 0 auto;
}