-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💄 Add group and separator components
- Loading branch information
1 parent
67c5f27
commit 16d309d
Showing
7 changed files
with
91 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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,18 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
browser-group { | ||
display: flex; | ||
gap: inherit; | ||
} | ||
|
||
browser-group[orientation=vertical], | ||
:host([orientation=vertical]) browser-group:not([orientation]) { | ||
flex-direction: column; | ||
} | ||
|
||
browser-group[orientation=horizontal], | ||
:host([orientation=horizontal]) browser-group:not([orientation]) { | ||
flex-direction: row; | ||
} |
This file contains 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,17 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
class BrowserGroup extends BrowserContextualMixin(MozHTMLElement) { | ||
/** | ||
* The allowed customizable attributes for the group | ||
*/ | ||
static get customizableAttributes() { | ||
return { | ||
orientation: "orientation", | ||
mode: "mode" | ||
}; | ||
} | ||
} | ||
|
||
customElements.define("browser-group", BrowserGroup); |
This file contains 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,28 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
browser-separator { | ||
display: flex; | ||
background-color: var(--chrome-content-separator-color, color-mix(in srgb, currentColor 5%, transparent 100%)); | ||
|
||
--size: 100%; | ||
} | ||
|
||
:host([orientation=vertical]) browser-separator, | ||
browser-separator[orientation=vertical] { | ||
width: var(--size); | ||
height: 1px; | ||
} | ||
|
||
:host([orientation=horizontal]) browser-separator, | ||
browser-separator[orientation=horizontal] { | ||
width: 1px; | ||
height: var(--size); | ||
} | ||
|
||
:host(.browser-panel-container) browser-separator { | ||
--size: calc(100% - 4px * 2); | ||
margin: 0 4px; | ||
background: linear-gradient(to top, var(--arrowpanel-border-color), var(--arrowpanel-border-color)), color-mix(in srgb, currentColor 15%, transparent 100%); | ||
} |
This file contains 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,16 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
class BrowserSeparator extends BrowserContextualMixin(MozHTMLElement) { | ||
/** | ||
* The allowed customizable attributes for the group | ||
*/ | ||
static get customizableAttributes() { | ||
return { | ||
orientation: "orientation" | ||
}; | ||
} | ||
} | ||
|
||
customElements.define("browser-separator", BrowserSeparator); |
This file contains 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 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