diff --git a/src/assets/scss/app.scss b/src/assets/scss/app.scss index c47cc3d5a..463a689cc 100644 --- a/src/assets/scss/app.scss +++ b/src/assets/scss/app.scss @@ -40,21 +40,26 @@ h1, .h1 { p { @include text-block; } -dl > div { +dl > * { border-bottom: 1px solid #ddd; - display: flex; padding-bottom: 10px; padding-top: 10px; - &:first-child { padding-top: 0; } + &:first-of-type { padding-top: 0; } - &:last-child { + &:last-of-type { border-bottom: none; padding-bottom: 0; } } + +// Normal
elements that are not .dl-horizontal are expected to have +// children that are
elements. Each
must contain a
and a
. dl:not(.dl-horizontal) { - > div { flex-direction: column-reverse; } + > div { + display: flex; + flex-direction: column-reverse; + } dt { color: #666; @@ -63,14 +68,28 @@ dl:not(.dl-horizontal) { dd { font-size: 16px; } } + +//
elements that are .dl-horizontal are expected to have children that are +//
and
elements. That's different from how other
elements work, +// as their children are expected to be
elements. The difference comes +// down to the fact that .dl-horizontal uses a CSS grid, while other
+// elements use flexbox. .dl-horizontal { - dt { - @include text-overflow-ellipsis; - flex-shrink: 0; - width: 160px; - } + $padding-between: 10px; + $dt-width: 160px + $padding-panel-body + $padding-between; + + display: grid; + // Components may override grid-template-columns in order to adjust the width + // of the
. + grid-template-columns: $dt-width 1fr; + + dt { padding-left: $padding-panel-body; } + dd { padding-right: $padding-panel-body; } - dd { margin-left: 20px; } + // Equally distribute the padding between the
and the
so that it is + // easy for components to give the two elements the same width. + dt { padding-right: $padding-between; } + dd { padding-left: $padding-between; } } .dfn { border-bottom: 2px dotted #999; } diff --git a/src/components/entity/upload/header-errors.vue b/src/components/entity/upload/header-errors.vue index 389fc8c57..cfa7ec9a4 100644 --- a/src/components/entity/upload/header-errors.vue +++ b/src/components/entity/upload/header-errors.vue @@ -11,38 +11,42 @@ except according to the terms contained in the LICENSE file. --> @@ -108,20 +112,18 @@ const formattedDelimiter = computed(() => formatCSVDelimiter(props.delimiter)); #entity-upload-header-errors { margin-bottom: 0; - div { - padding-left: $padding-panel-body; - padding-right: $padding-panel-body; - } - .csv-header { @include line-clamp(3); font-family: $font-family-monospace; overflow-x: auto; white-space: break-spaces; } + dd:has(.csv-header) { overflow-x: hidden; } } -#entity-upload-header-errors-suggestions { +#entity-upload-header-errors-filename { @include text-overflow-ellipsis; } + +.entity-upload-header-errors-suggestions { color: $color-danger; p:last-child { margin-bottom: 0; } diff --git a/test/components/entity/upload/header-errors.spec.js b/test/components/entity/upload/header-errors.spec.js index c3bb36c1b..d91258b5c 100644 --- a/test/components/entity/upload/header-errors.spec.js +++ b/test/components/entity/upload/header-errors.spec.js @@ -36,7 +36,7 @@ describe('EntityUploadHeaderErrors', () => { describe('suggestions', () => { const getSuggestion = (component) => { - const p = component.findAll('#entity-upload-header-errors-suggestions p'); + const p = component.findAll('.entity-upload-header-errors-suggestions p'); p.length.should.equal(1); return p[0]; }; @@ -48,7 +48,7 @@ describe('EntityUploadHeaderErrors', () => { const component = mountComponent({ props: { header: 'label', missingProperty: true } }); - component.find('#entity-upload-header-errors-suggestions').exists().should.be.false; + component.find('.entity-upload-header-errors-suggestions').exists().should.be.false; }); describe('delimiter is not a comma', () => {