- 
                Notifications
    You must be signed in to change notification settings 
- Fork 87
feat: aura master-detail-layout and side-nav #10153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    
  
     Merged
                    Changes from 3 commits
      Commits
    
    
            Show all changes
          
          
            6 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      c8a2ffc
              
                feat: side-nav and MDL themes
              
              
                jouni 89230b1
              
                Update master-detail-layout.css
              
              
                jouni 5e647d1
              
                chore: add import and feature flag for MDL
              
              
                web-padawan 69b7bda
              
                Update packages/aura/src/components/side-nav.css
              
              
                web-padawan 5120a5a
              
                remove unused code
              
              
                jouni aeef843
              
                remove unused code
              
              
                jouni File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
      
      Loading
      
  Sorry, something went wrong. Reload?
      Sorry, we cannot display this file.
      Sorry, this file is invalid so it cannot be displayed.
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| vaadin-master-detail-layout::part(detail) { | ||
| --aura-surface-level: 2; | ||
| background: var(--aura-surface) padding-box; | ||
| } | ||
|  | ||
| vaadin-master-detail-layout[drawer]::part(detail) { | ||
| --aura-surface-opacity: var(--aura-overlay-surface-opacity); | ||
| background: var(--aura-surface) padding-box; | ||
| -webkit-backdrop-filter: var(--aura-overlay-backdrop-filter); | ||
| backdrop-filter: var(--aura-overlay-backdrop-filter); | ||
| box-shadow: | ||
| inset 1px 0 0 0 var(--aura-overlay-inner-outline-color), | ||
| -1px 0 0 0 var(--aura-overlay-outline-color), | ||
| var(--aura-shadow-m); | ||
| } | ||
|  | ||
| vaadin-master-detail-layout[containment='viewport'][drawer]::part(detail) { | ||
| box-shadow: var(--aura-overlay-shadow); | ||
| } | ||
|  | ||
| /* TODO could be a built-in variant */ | ||
| vaadin-master-detail-layout[theme~='inset-drawer'][drawer]::part(detail), | ||
| vaadin-master-detail-layout[containment='viewport'][drawer]::part(detail) { | ||
| margin: calc(var(--aura-app-layout-inset) / 2); | ||
| border-radius: var(--_app-layout-radius); | ||
| } | ||
|  | ||
| vaadin-master-detail-layout > vaadin-master-detail-layout, | ||
| vaadin-master-detail-layout:not([drawer])::part(detail) { | ||
| border-start-end-radius: var(--_app-layout-radius); | ||
| border-end-end-radius: var(--_app-layout-radius); | ||
| } | ||
|  | ||
| /* TODO these end up affecting all MDLs, not just the one directly inside the App Layout */ | ||
| ::view-transition-group(vaadin-mdl-backdrop), | ||
| ::view-transition-group(vaadin-mdl-master), | ||
| ::view-transition-group(vaadin-mdl-detail) { | ||
| border-radius: var(--_app-layout-radius); | ||
| overflow: hidden; | ||
| } | ||
|  | ||
| /* ::view-transition-group(vaadin-mdl-detail.viewport) { | ||
| border-radius: 0; | ||
| overflow: visible; | ||
| } */ | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| html { | ||
|         
                  web-padawan marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| --vaadin-side-nav-label-line-height: var(--aura-line-height-xs); | ||
| --vaadin-side-nav-label-font-weight: var(--aura-font-weight-medium); | ||
| --vaadin-side-nav-item-font-weight: var(--aura-font-weight-medium); | ||
| --vaadin-side-nav-item-border-width: 1px; | ||
| --vaadin-side-nav-items-gap: var(--vaadin-gap-xs); | ||
| } | ||
|  | ||
| vaadin-side-nav + vaadin-side-nav { | ||
| margin-top: var(--vaadin-gap-l); | ||
| } | ||
|  | ||
| vaadin-side-nav-item::part(content) { | ||
| transition: | ||
| color 120ms, | ||
| border-color 120ms, | ||
| background-color 120ms; | ||
| background-clip: padding-box; | ||
| --aura-surface-level: 3; | ||
| } | ||
|  | ||
| vaadin-side-nav-item:not([disabled])::part(content):hover { | ||
| --vaadin-side-nav-item-color: var(--vaadin-color); | ||
| } | ||
|  | ||
| vaadin-side-nav-item[current]::part(content) { | ||
| --vaadin-side-nav-item-background: var(--aura-surface); | ||
| --vaadin-side-nav-item-border-color: var(--vaadin-border-color-subtle); | ||
| } | ||
|  | ||
| /* @media (prefers-reduced-motion: no-preference) { | ||
|         
                  jouni marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| vaadin-side-nav[collapsed]::part(children), | ||
| vaadin-side-nav-item::part(children) { | ||
| --vaadin-side-nav-hidden-display: flex; | ||
| transition: 200ms; | ||
| transition-property: display, height, opacity; | ||
| transition-behavior: allow-discrete; | ||
| interpolate-size: allow-keywords; | ||
| overflow: hidden; | ||
| height: 0; | ||
|  | ||
| @starting-style { | ||
| height: 0; | ||
| opacity: 0; | ||
| } | ||
| } | ||
|  | ||
| vaadin-side-nav:not([collapsed])::part(children), | ||
| vaadin-side-nav-item[expanded]::part(children) { | ||
| height: auto; | ||
| } | ||
| } */ | ||
|  | ||
| /* Contrast variant */ | ||
|  | ||
| vaadin-side-nav[theme~='contrast'] vaadin-side-nav-item[current]::part(content) { | ||
| color-scheme: var(--_side-nav-current-item-color-scheme, dark); | ||
| background: var(--aura-surface-solid); | ||
| border-color: transparent; | ||
| outline-offset: 2px; | ||
| } | ||
|  | ||
| vaadin-side-nav[theme~='contrast'] vaadin-side-nav-item[current] > :not([slot='children']) { | ||
| --aura-red: var(--vaadin-color); | ||
| --aura-red-text: var(--vaadin-color); | ||
| --aura-orange: var(--vaadin-color); | ||
| --aura-orange-text: var(--vaadin-color); | ||
| --aura-yellow: var(--vaadin-color); | ||
| --aura-yellow-text: var(--vaadin-color); | ||
| --aura-green: var(--vaadin-color); | ||
| --aura-green-text: var(--vaadin-color); | ||
| --aura-blue: var(--vaadin-color); | ||
| --aura-blue-text: var(--vaadin-color); | ||
| --aura-purple: var(--vaadin-color); | ||
| --aura-purple-text: var(--vaadin-color); | ||
| } | ||
|  | ||
| @container style(--aura-color-scheme: dark) { | ||
| [slot='drawer'] { | ||
| --_side-nav-current-item-color-scheme: light; | ||
| } | ||
| } | ||
|  | ||
| @container style(--aura-content-color-scheme: dark) { | ||
| vaadin-app-layout > :not([slot]) { | ||
| --_side-nav-current-item-color-scheme: light; | ||
| } | ||
| } | ||
|  | ||
| @container style(--aura-content-color-scheme: light) { | ||
| vaadin-app-layout > :not([slot]) { | ||
| --_side-nav-current-item-color-scheme: dark; | ||
| } | ||
| } | ||
|  | ||
| @media (prefers-color-scheme: dark) { | ||
| @container style(--aura-content-color-scheme: light dark) { | ||
| vaadin-app-layout > :not([slot]) { | ||
| --_side-nav-current-item-color-scheme: light; | ||
| } | ||
| } | ||
|  | ||
| @container style(--aura-color-scheme: light dark) { | ||
| [slot='drawer'] { | ||
| --_side-nav-current-item-color-scheme: light; | ||
| } | ||
| } | ||
| } | ||
|  | ||
| /* TODO bug in component/base styles: hide label part if no label is provided */ | ||
| vaadin-side-nav:not(:has([slot='label']))::part(label) { | ||
| display: none; | ||
| } | ||
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.