Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
vittoriaThinkst authored and wleightond committed Dec 5, 2024
1 parent 81bc8d0 commit c9892a4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
>
<a
v-bind="$attrs"
class="bg-cover min-w-[2.5rem] min-h-[2.2rem] duration-100"
class="bg-cover min-w-[2.5rem] min-h-[2.2rem] duration-100 aspect-square"
:class="{ 'bg-grey-200 cursor-default': props.disabled }"
:style="
!props.disabled && props.url
Expand Down
27 changes: 19 additions & 8 deletions frontend_vue/src/components/base/BaseFormSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<v-select
:id="id"
class="v-select"
:class="{ 'invalid': errorMessage }"
:class="{ invalid: errorMessage }"
:style="`--vs-dropdown-height: ${props.height}`"
:options="options"
:searchable="searchable"
Expand Down Expand Up @@ -40,8 +40,8 @@
></slot>
</template>
</v-select>
<div class="h-8 mt-4 ml-16">
<p
<div class="h-8 mt-4 ml-16">
<p
v-if="errorMessage"
class="text-xs text-red leading-[0px]"
>
Expand All @@ -54,8 +54,7 @@
import { toRef, onMounted } from 'vue';
import { useField } from 'vee-validate';
export type SelectOption = { label: string, value: string };
export type SelectOption = { label: string; value: string };
const props = defineProps<{
id: string;
Expand Down Expand Up @@ -86,15 +85,14 @@ onMounted(() => {
function handleSelectOption(value: string | SelectOption) {
if (typeof value === 'object') {
value = value.value
};
value = value.value;
}
handleChange(value);
emits('selectOption', value);
}
</script>

<style lang="scss">
.focus-visible {
outline: 2px solid;
outline-color: hsl(191, 96%, 36%);
Expand All @@ -110,6 +108,7 @@ function handleSelectOption(value: string | SelectOption) {
.v-select .vs__dropdown-menu {
@apply mt-[8px] bg-white shadow-none border-grey-300 rounded-xl;
height: var(--vs-dropdown-height);
border-top-style: solid;
}
.v-select .vs__clear {
Expand All @@ -123,11 +122,23 @@ function handleSelectOption(value: string | SelectOption) {
@apply text-grey-500;
}
.v-select .vs__dropdown-option:first-child {
@apply mt-[0.5rem];
}
.v-select .vs__dropdown-option:last-child {
@apply mb-[0.5rem];
}
.v-select .vs__dropdown-option--highlight {
@apply bg-green-500 text-white;
}
.v-select.invalid > .vs__dropdown-toggle {
@apply border border-red;
}
.vs__selected {
@apply m-0;
}
</style>
12 changes: 8 additions & 4 deletions frontend_vue/src/components/tokens/idp_app/GenerateTokenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@
<div class="flex flex-row items-center gap-16">
<div
alt="icon"
:style="{ backgroundImage: `url(${getImageUrl('idp_icons/'+option.value+'.png')})` }"
:style="{
backgroundImage: `url(${getImageUrl('idp_icons/' + option.value + '.png')})`,
}"
class="bg-cover w-[2rem] h-[2rem] duration-100"
></div>
{{ option.label }}
</div>
</template>

<template #selected-option="{ option }">
<div class="flex flex-row items-center gap-16">
<div class="flex flex-row items-center gap-8">
<div
alt="icon"
:style="{ backgroundImage: `url(${getImageUrl('idp_icons/'+option.value+'.png')})` }"
:style="{
backgroundImage: `url(${getImageUrl('idp_icons/' + option.value + '.png')})`,
}"
class="bg-cover w-[1.5rem] h-[1.5rem] duration-100"
></div>
{{ option.label }}
Expand Down Expand Up @@ -61,6 +65,6 @@ type SelectedAppType = {
const selectedApp = ref<SelectedAppType>();
function handleSelectedApp(selected: string) {
selectedApp.value = IDP_OPTIONS.find(o => o.value === selected);
selectedApp.value = IDP_OPTIONS.find((o) => o.value === selected);
}
</script>

0 comments on commit c9892a4

Please sign in to comment.