fix(regression): button width CSS definition

This commit is contained in:
upsiflu 2025-01-02 20:23:08 +01:00
parent 2d5d7ee2ad
commit 4a62f05d1e
3 changed files with 16 additions and 9 deletions

View File

@ -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);

View File

@ -91,6 +91,12 @@ onMounted(() => {
line-height: 1em;
// Content
> span {
line-height: initial;
}
// Decoration
cursor: pointer;

View File

@ -15,7 +15,7 @@ export type Key = KeysOfUnion<WidthProps>
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;",
@ -25,7 +25,7 @@ const styles = {
const getStyle = (props: Partial<WidthProps>) => (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
@ -41,7 +41,7 @@ const conflicts: Set<Key>[] = [
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 : '')
})
/**