You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: pfe-navigation - report pfe-nav's height in a global CSS variable (#732)
* feat(pfe-navigation): report pfe-nav's height in a global CSS variable
* update changelog
* change the height var to be more BEMy
* set nav height variable to use px
* fixed merge conflict
* fixed variable name in readme
* fixed typo in readme
* fixed nav test to use correct variable name
* set height custom property to use underscores only if region is declared.
* added px value back into variable.
* removed px string from custom height property to match clientHeight.
* Updated nav readme, fixed typo and replaced ellipses with colon
Co-authored-by: Chris Doherty <[email protected]>
Co-authored-by: Kendall Totten <[email protected]>
-[f93af30](https://github.com/patternfly/patternfly-elements/commit/f93af30cc7eef3e7728effb7cedb4773f54a5f43) feat: adding the ability for pfe-navigation to use the full width of the viewport (#718)
7
7
-[aac9925](https://github.com/patternfly/patternfly-elements/commit/aac992563a61495128c00d53f637d656bbe614dd) Update pfe-content-set to accept custom container queries
8
8
-[6e45ab4](https://github.com/patternfly/patternfly-elements/commit/6e45ab42617086fb7e229af3b0953ff6912c0273) feat: pfe-cta add support for disabled button, reduce lightdom needs
9
-
-[](https://github.com/patternfly/patternfly-elements/commit/) feat: Move generator into the monorepo
9
+
-[582ffc8](https://github.com/patternfly/patternfly-elements/commit/582ffc87fcbf2ef29aecf01967d19834a7aff116) feat: Move generator into the monorepo
10
+
-[](https://github.com/patternfly/patternfly-elements/commit/) feat(pfe-navigation): report pfe-nav's height in a global CSS variable (#732)
Copy file name to clipboardExpand all lines: elements/pfe-navigation/README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,11 @@ All slots are optional and can be left off if not needed. Slots prefixed with `m
66
66
- `pfe-menu-label`: Translation for the Menu label on the main navigation dropdown.
67
67
- `pfe-full-width`: Allows the navigation to span the full width of the viewport.
68
68
69
+
### CSS Variables
70
+
71
+
- `--pfe-navigation--Height--actual`: when pfe-navigation initializes, it will create a global (on `body`) CSS variable that contains the height of the pfe-navigation item. The primary uses for this is calculating the offset for anchor links, and for positioning a sticky sub-header below the pfe-navigation. Note that multiple pfe-navigation elements will write the same variable, unless:
72
+
- `--pfe-navigation__${ID}--Height--actual`: like the previous variable, but if the pfe-navigation has an `id` attribute, it will be appended to the CSS variable name. This makes it possible to distinguish the heights of multiple pfe-navigation elements on the same page.
0 commit comments