mirror of
				https://github.com/notion-enhancer/notion-enhancer.git
				synced 2025-10-31 14:18:08 +11:00 
			
		
		
		
	
		
			
				
	
	
		
			223 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			CSS
		
	
	
	
	
	
			
		
		
	
	
			223 lines
		
	
	
		
			4.2 KiB
		
	
	
	
		
			CSS
		
	
	
	
	
	
| /**
 | |
|  * notion-enhancer: tabs
 | |
|  * (c) 2021 dragonwocky <thedragonring.bod@gmail.com> (https://dragonwocky.me/)
 | |
|  * (https://notion-enhancer.github.io/) under the MIT license
 | |
|  */
 | |
| 
 | |
| * {
 | |
|   box-sizing: border-box;
 | |
| }
 | |
| 
 | |
| html,
 | |
| body {
 | |
|   height: 100%;
 | |
|   width: 100%;
 | |
|   margin: 0;
 | |
|   padding: 0;
 | |
|   background: var(--theme--bg) !important;
 | |
|   overflow: hidden;
 | |
| }
 | |
| 
 | |
| body {
 | |
|   display: flex;
 | |
|   flex-direction: column;
 | |
| }
 | |
| 
 | |
| header {
 | |
|   display: flex;
 | |
|   background: var(--theme--bg_secondary);
 | |
|   border-bottom: 1px solid var(--theme--ui_divider);
 | |
|   width: 100%;
 | |
|   padding: 0.5em;
 | |
|   user-select: none;
 | |
|   -webkit-app-region: drag;
 | |
|   z-index: 3;
 | |
|   font-size: 16px;
 | |
| }
 | |
| 
 | |
| #tabs {
 | |
|   display: flex;
 | |
|   overflow: hidden;
 | |
| }
 | |
| .tab {
 | |
|   display: flex;
 | |
|   flex-grow: 1;
 | |
|   flex-shrink: 1;
 | |
|   width: 14em;
 | |
|   max-width: 14em;
 | |
|   overflow: hidden;
 | |
|   padding: 0.4em 0.6em 0.4em 0.6em;
 | |
| 
 | |
|   color: var(--theme--text_secondary);
 | |
|   background: var(--theme--bg);
 | |
|   font-family: var(--theme--font_sans);
 | |
|   font-weight: 500;
 | |
|   border: none;
 | |
|   -webkit-app-region: no-drag;
 | |
| }
 | |
| .tab:hover {
 | |
|   background: var(--theme--ui_interactive-hover);
 | |
| }
 | |
| .tab.current {
 | |
|   background: var(--theme--ui_interactive-active);
 | |
| }
 | |
| #tabs.dragged-over {
 | |
|   box-shadow: 2px 0 0 0 var(--theme--accent_blue-selection);
 | |
| }
 | |
| .tab.dragged-over {
 | |
|   box-shadow: inset 2px 0 0 0 var(--theme--accent_blue-selection);
 | |
| }
 | |
| 
 | |
| .tab-title {
 | |
|   white-space: nowrap;
 | |
|   overflow: hidden;
 | |
| }
 | |
| .tab-icon {
 | |
|   font-size: 0.875em;
 | |
|   margin-right: 0.375em;
 | |
| }
 | |
| .tab-icon[style*='background'] {
 | |
|   width: 0.875em;
 | |
|   height: 0.875em;
 | |
|   align-self: center;
 | |
|   margin: 0 0.5em 2px 0;
 | |
| }
 | |
| .tab-icon:not([style*='background']):empty,
 | |
| .tab-icon + svg {
 | |
|   display: none;
 | |
| }
 | |
| .tab-icon:not([style*='background']):empty + svg {
 | |
|   /* placeholder icon */
 | |
|   display: inline-block;
 | |
|   margin: 1px 0.5em 0 0;
 | |
|   width: 1.125em;
 | |
|   height: 1.125em;
 | |
|   display: block;
 | |
|   backface-visibility: hidden;
 | |
|   fill: var(--theme--icon_secondary);
 | |
| }
 | |
| 
 | |
| .new-tab,
 | |
| .tab-close {
 | |
|   transition: background 20ms ease-in 0s;
 | |
|   cursor: pointer;
 | |
|   display: inline-flex;
 | |
|   align-items: center;
 | |
|   justify-content: center;
 | |
|   flex-shrink: 0;
 | |
|   border-radius: 0.1875em;
 | |
|   height: 1.25em;
 | |
|   width: 1.25em;
 | |
|   padding: 0 0.25px 0 0;
 | |
| 
 | |
|   border: none;
 | |
|   background: transparent;
 | |
|   font-size: 0.875em;
 | |
|   -webkit-app-region: no-drag;
 | |
| }
 | |
| .new-tab svg,
 | |
| .tab-close svg {
 | |
|   width: 0.875em;
 | |
|   height: 0.875em;
 | |
|   fill: var(--theme--icon_secondary);
 | |
|   color: var(--theme--icon_secondary);
 | |
| }
 | |
| .new-tab:focus,
 | |
| .new-tab:hover,
 | |
| .tab-close:focus,
 | |
| .tab-close:hover {
 | |
|   background: var(--theme--ui_interactive-hover);
 | |
| }
 | |
| .new-tab:active,
 | |
| .tab-close:active {
 | |
|   background: var(--theme--ui_interactive-active);
 | |
| }
 | |
| 
 | |
| .new-tab {
 | |
|   align-self: center;
 | |
|   margin: 0 3em 0 0.375em;
 | |
| }
 | |
| .tab-close {
 | |
|   margin-left: auto;
 | |
| }
 | |
| 
 | |
| #window-actions {
 | |
|   display: flex;
 | |
|   align-items: center;
 | |
|   margin-left: auto;
 | |
| }
 | |
| #window-actions > * {
 | |
|   -webkit-app-region: no-drag;
 | |
| }
 | |
| 
 | |
| [data-tab-labels='page title only'] .tab-icon {
 | |
|   display: none;
 | |
| }
 | |
| [data-tab-labels='page icon only'] .tab {
 | |
|   width: 4em;
 | |
|   max-width: 4em;
 | |
| }
 | |
| [data-tab-labels='page icon only'] .tab-title {
 | |
|   display: none;
 | |
| }
 | |
| 
 | |
| [data-tab-style='rectangular'] .new-tab,
 | |
| [data-tab-style='traditional tabbed'] .new-tab {
 | |
|   margin-bottom: -0.25em;
 | |
| }
 | |
| [data-tab-style='rectangular'] #tabs {
 | |
|   margin-bottom: -0.5em;
 | |
| }
 | |
| [data-tab-style='traditional tabbed'] header {
 | |
|   padding-top: 0.6875em;
 | |
| }
 | |
| [data-tab-style='traditional tabbed'] #tabs {
 | |
|   margin: -0.1875em 0 -0.5em 0;
 | |
| }
 | |
| [data-tab-style='traditional tabbed'] .tab {
 | |
|   border-top-left-radius: 0.875em;
 | |
|   border-top-right-radius: 0.875em;
 | |
|   padding: 0.6em 0.6em 0.4em 0.6em;
 | |
| }
 | |
| [data-tab-style='bubble'] .tab {
 | |
|   border-radius: 0.375em;
 | |
| }
 | |
| [data-tab-style='bubble'] .tab:not(:first-child) {
 | |
|   margin-left: 0.5em;
 | |
| }
 | |
| [data-tab-style='compact'] header {
 | |
|   padding: 0;
 | |
|   font-size: 14px;
 | |
| }
 | |
| [data-tab-style='compact'] .tab-close {
 | |
|   align-self: center;
 | |
| }
 | |
| [data-tab-style='compact'] #window-actions {
 | |
|   transform: scale(0.8);
 | |
|   margin-right: -0.35em;
 | |
| }
 | |
| 
 | |
| #root {
 | |
|   flex-grow: 1;
 | |
| }
 | |
| .notion-webview {
 | |
|   width: 100%;
 | |
|   height: 100%;
 | |
|   display: none;
 | |
| }
 | |
| .search-webview {
 | |
|   width: 100%;
 | |
|   height: 60px;
 | |
|   display: none;
 | |
|   transition: transform 70ms ease-in;
 | |
|   transform: translateY(-100%);
 | |
|   pointer-events: none;
 | |
|   position: absolute;
 | |
|   z-index: 2;
 | |
| }
 | |
| .search-webview.search-active {
 | |
|   transition: transform 70ms ease-out;
 | |
|   transform: translateY(0%);
 | |
|   pointer-events: auto;
 | |
| }
 |