Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-27652

Improve layout styles sharing mechanism

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Web UI
    • Release Notes Description:
      Hide
      • Widget styles moved from layouts to the nuxeo-styles module.
      • Added --nuxeo-widget mixin.
      • Added --nuxeo-results-view-min-height and --nuxeo-results-view-height css variables to nuxeo-results.
      • Removed iron-positioning style from nuxeo-styles.
      Show
      Widget styles moved from layouts to the nuxeo-styles module. Added --nuxeo-widget mixin. Added --nuxeo-results-view-min-height and --nuxeo-results-view-height css variables to nuxeo-results . Removed iron-positioning style from nuxeo-styles .
    • Team:
      GANG
    • Sprint:
      nxGang Sprint 11.1.14, nxGang Sprint 11.1.15
    • Story Points:
      5

      Description

      As described in NXS-5205, we need to think about a better way to provide common doc type layouts styles.

      Original issue is that View Designer does not generate the proper css styles for metadata layouts. It adds:

          <style>
            *[role=widget] {
              padding: 5px;
            }
          </style>
      

      while it should have generated:

          <style>
            *[role=widget] {
              margin-bottom: 16px;
            }
            label {
              @apply --nuxeo-label;
            }
            div.multiline {
              white-space: pre-line;
            }
            div {
              word-wrap: break-word;
              overflow-wrap: break-word;
              word-break: break-word;
              -webkit-hyphens: auto;
              -moz-hyphens: auto;
              -ms-hyphens: auto;
              -o-hyphens: auto;
              hyphens: auto;
            }
          </style>
      

      as in https://github.com/nuxeo/nuxeo-web-ui/blob/cdc1e17874787392d98dcaa02084a0e6208ca404/elements/document/file/nuxeo-file-metadata-layout.html#L26

      I believe the metadata layouts needs these special CSS rules to behave well on the right-hand side of the browser.

      The easy fix would be to make sure VD handles this specificity for metadata layouts (which we could maybe do for a 10.10TP fix?).
      However, this is hardly maintainable as next time we'll change or add specific rules to a layout type, VD will also need adaptations.

      Possible solutions/things to check:

      • shouldn't we need the the metadata styles on all layouts?
      • introduce some layouts common styles and add:
        <style include="nuxeo-doc-layouts-styles">
        

        to our html layouts. We could even introduce per layout type styles e.g. nuxeo-doc-metadata-layouts-styles

      However, adding a layout style module will fragment styling between this module and nuxeo-styles. We will instead clean up nuxeo-styles, making the layout css rules more specific, and adding these to nuxeo-styles. See specs in TL-313. From now on, elements scaffolded on studio should now have include="nuxeo-styles" on their style block.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 4 hours
                  2d 4h