diff --git a/front/src/components/ui/Card.vue b/front/src/components/ui/Card.vue index 08c791e8d..2e4c8b837 100644 --- a/front/src/components/ui/Card.vue +++ b/front/src/components/ui/Card.vue @@ -136,6 +136,7 @@ const attributes = computed(() => object-fit: cover; width: 100%; aspect-ratio: 1; + position:relative; &.with-padding { margin: var(--fw-card-padding) var(--fw-card-padding) calc(var(--fw-card-padding) / 2) var(--fw-card-padding); diff --git a/front/src/components/ui/Link.vue b/front/src/components/ui/Link.vue index 086954710..258947761 100644 --- a/front/src/components/ui/Link.vue +++ b/front/src/components/ui/Link.vue @@ -91,6 +91,12 @@ onMounted(() => { line-height: 1em; + // Content + + > span { + line-height: initial; + } + // Decoration cursor: pointer; diff --git a/front/src/composables/width.ts b/front/src/composables/width.ts index f46562beb..eb006e597 100644 --- a/front/src/composables/width.ts +++ b/front/src/composables/width.ts @@ -15,23 +15,23 @@ export type Key = KeysOfUnion const styles = { minContent: 'width: min-content;', tiny: "width: 124px; grid-column: span 2;", - buttonWidth: "width: max(136px, min-content); grid-column: span 2; flex-grow: 0; align-self: start;", + buttonWidth: "width: 136px; grid-column: span 2; flex-grow: 0; min-width: min-content;", small: "width: 202px; grid-column: span 3;", medium: "width: 280px; grid-column: span 4;", auto: "width: auto;", full: "width: auto; grid-column: 1 / -1; place-self: stretch; flex-grow: 1;", - width: (w:string)=>`width: ${w}; flex-grow:0;`, -} as const satisfies Recordstring)>; + width: (w: string) => `width: ${w}; flex-grow:0;`, +} as const satisfies Record string)>; -const getStyle = (props : Partial) => (key : Key):string => +const getStyle = (props: Partial) => (key: Key): string => // @ts-ignore - (typeof styles[key] === 'function' && key in props) ? + typeof styles[key] === 'function' && key in props ? styles[key]( // TODO: Make the typescript compiler understand `key in props` // @ts-ignore props[key] - ) - : styles[key] + ) + : styles[key] // All keys are exclusive const conflicts: Set[] = [ @@ -41,7 +41,7 @@ const conflicts: Set[] = [ const merge = (rules: string[]) => (attributes: HTMLAttributes = {}) => rules.length === 0 ? attributes : ({ ...attributes, - style: rules.join(' ') + ('style' in attributes ? attributes.style + ' ' : '') + style: rules.join(' ') + ('style' in attributes ? ' ' + attributes.style : '') }) /** @@ -60,7 +60,7 @@ const merge = (rules: string[]) => (attributes: HTMLAttributes = {}) => export const width = >( props: TProps, defaults: Key[] = [] -) => merge ( +) => merge( (Object.entries(props) as Entries).reduce( ((acc, [key, value]) => value && key in styles ?