-
Notifications
You must be signed in to change notification settings - Fork 77
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
fix(panel): apply custom styles correctly to header actions #11495
Changes from 4 commits
2b314be
1af7a1c
ca25807
9e588ac
b6da073
68b10a9
f9ba8db
b2bfdc8
268be2b
dd6a471
dd25cc8
c9510fc
5a4b35d
fe9aecd
e4f8ad1
b208eeb
4047849
a8d3351
6b2862d
6c543b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -9,25 +9,25 @@ | |||
* @prop --calcite-panel-border-color: Specifies the component's border color. | ||||
* @prop --calcite-panel-background-color: Specifies the component's background color. | ||||
* @prop --calcite-panel-header-background-color: Specifies the background color of the component's header. | ||||
* @prop --calcite-panel-header-action-background-color: Specifies the background color of the component's `header-actions`. | ||||
* @prop --calcite-panel-header-action-background-color-hover: Specifies the background color of the component's `header-actions` when hovered. | ||||
* @prop --calcite-panel-header-action-background-color-press: Specifies the background color of the component's `header-actions` when pressed or active. | ||||
* @prop --calcite-panel-header-action-text-color: Specifies the text and icon color of the component's `header-actions`. | ||||
* @prop --calcite-panel-header-action-text-color-hover: Specifies the text and icon color of the component's `header-actions` when hovered. | ||||
* @prop --calcite-panel-header-action-text-color-press: Specifies the text and icon color of the component's `header-actions` when pressed or active. | ||||
alisonailea marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
* @prop --calcite-panel-footer-background-color: Specifies the background color of the component's footer. | ||||
* @prop --calcite-panel-space: Specifies the padding of the component's `"unnamed (default)"` slot. | ||||
* @prop --calcite-panel-header-content-space: Specifies the padding of the `"header-content"` slot. | ||||
* @prop --calcite-panel-footer-space: Specifies the padding of the component's footer. | ||||
* @prop --calcite-action-background-color: Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s. Applies to any slotted `calcite-action`s. | ||||
* @prop --calcite-action-background-color-hover: Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when hovered. Applies to any slotted `calcite-action`s. | ||||
* @prop --calcite-action-background-color-pressed: Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when pressed. Applies to any slotted `calcite-action`s. | ||||
* @prop --calcite-action-text-color-hover: Specifies the text and icon color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when hovered. Applies to any slotted `calcite-action`s. | ||||
* @prop --calcite-action-text-color-pressed: Specifies the text and icon color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when pressed. Applies to any slotted `calcite-action`s. | ||||
* @prop --calcite-action-background-color: Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s. Applies to any slotted `calcite-action`s. Use ::part(header) or ::part(footer) to target sets of calcite-actions. | ||||
* @prop --calcite-action-background-color-hover: Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when hovered. Applies to any slotted `calcite-action`s. Use ::part(header) or ::part(footer) to target sets of calcite-actions. | ||||
* @prop --calcite-action-background-color-pressed: Specifies the background color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when pressed. Applies to any slotted `calcite-action`s. Use ::part(header) or ::part(footer) to target sets of calcite-actions. | ||||
* @prop --calcite-action-text-color-hover: Specifies the text and icon color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when hovered. Applies to any slotted `calcite-action`s. Use ::part(header) or ::part(footer) to target sets of calcite-actions. | ||||
* @prop --calcite-action-text-color-pressed: Specifies the text and icon color of the component's `closable`, `collapsible`, and `back` `calcite-action`s when pressed. Applies to any slotted `calcite-action`s. Use ::part(header) or ::part(footer) to target sets of calcite-actions. | ||||
alisonailea marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
* @prop --calcite-popover-border-color: Specifies the border color of the component's internally rendered `calcite-popover`, which is rendered within a `calcite-action` menu when slotted `calcite-action`s are present in the `header-actions-end` slot. Applies to any slotted `calcite-popover`s. | ||||
* @prop --calcite-panel-content-space: [Deprecated] Use `--calcite-panel-space` instead. Specifies the padding of the component's content. | ||||
* @prop --calcite-panel-footer-padding: [Deprecated] Use `--calcite-panel-footer-space` instead. Specifies the padding of the component's footer. | ||||
* @prop --calcite-panel-header-border-block-end: [Deprecated] Use `--calcite-panel-border-color` instead. Specifies the component header's block end border. | ||||
* @prop --calcite-panel-header-action-background-color-hover: Specifies the background color of the component's `calcite-action` items in the panel header when hovered. | ||||
alisonailea marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
* @prop --calcite-panel-header-action-background-color-press: Specifies the background color of the component's `calcite-action` items in the panel header when pressed. | ||||
* @prop --calcite-panel-header-action-background-color: Specifies the background color of the component's `calcite-action` items in the panel header. | ||||
* @prop --calcite-panel-header-action-indicator-color: Specifies the color of the component's `calcite-action` items' indicator in the panel header. | ||||
* @prop --calcite-panel-header-action-text-color-press: Specifies the text color of the component's `calcite-action` items in the panel header when pressed. | ||||
* @prop --calcite-panel-header-action-text-color: Specifies the text color of the component's `calcite-action` items in the panel header. | ||||
*/ | ||||
|
||||
:host { | ||||
|
@@ -149,15 +149,6 @@ | |||
margin-inline-end: auto; | ||||
justify-content: center; | ||||
|
||||
.header-actions { | ||||
--calcite-action-background-color-hover: var(--calcite-panel-header-action-background-color-hover); | ||||
--calcite-action-background-color-press: var(--calcite-panel-header-action-background-color-press); | ||||
--calcite-action-background-color: var(--calcite-panel-header-action-background-color); | ||||
--calcite-action-indicator-color: var(--calcite-panel-header-action-indicator-color); | ||||
--calcite-action-text-color-press: var(--calcite-panel-header-action-text-color-press); | ||||
--calcite-action-text-color: var(--calcite-panel-header-action-text-color); | ||||
} | ||||
|
||||
.heading, | ||||
.description { | ||||
@apply block | ||||
|
@@ -181,6 +172,27 @@ | |||
} | ||||
} | ||||
|
||||
.header { | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can be more specific here, just assigning these to the internally-rendered Actions ( calcite-design-system/packages/calcite-components/src/components/panel/panel.scss Line 170 in 0e1043f
If so, we can update the css prop descriptions to specifically state the elements affected (like you have for the "part example"). |
||||
::slotted(calcite-action), | ||||
calcite-action { | ||||
--calcite-action-background-color: var( | ||||
--calcite-panel-header-action-background-color, | ||||
var(--calcite-panel-header-background-color) | ||||
); | ||||
--calcite-action-background-color-hover: var(--calcite-panel-header-action-background-color-hover); | ||||
--calcite-action-background-color-press: var(--calcite-panel-header-action-background-color-press); | ||||
--calcite-action-text-color: var(--calcite-panel-header-action-text-color, var(--calcite-panel-header-text-color)); | ||||
--calcite-action-text-color-hover: var( | ||||
--calcite-panel-header-action-text-color-hover, | ||||
var(--calcite-panel-header-text-color-hover) | ||||
); | ||||
--calcite-action-text-color-press: var( | ||||
--calcite-panel-header-action-text-color-press, | ||||
var(--calcite-panel-header-text-color-press) | ||||
); | ||||
} | ||||
} | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No this is covered by the corner radius of the action containers. |
||||
|
||||
alisonailea marked this conversation as resolved.
Show resolved
Hide resolved
|
||||
.back-button { | ||||
@apply border-0 | ||||
border-solid; | ||||
|
@@ -209,12 +221,12 @@ calcite-action-menu { | |||
#collapse, | ||||
calcite-action-menu { | ||||
&:last-child { | ||||
--calcite-action-corner-radius-start-end: var(--calcite-panel-corner-radius); | ||||
border-radius-start-end: var(--calcite-panel-corner-radius, var(--calcite-corner-radius-none)); | ||||
} | ||||
} | ||||
|
||||
.back-button { | ||||
--calcite-action-corner-radius-start-start: var(--calcite-panel-corner-radius); | ||||
border-radius-start-start: var(--calcite-panel-corner-radius, var(--calcite-corner-radius-none)); | ||||
} | ||||
|
||||
.content-wrapper { | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't needed since
interaction-container
usesdisplay: contents
and doesn't produce a box.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For posterity: I restored this override as I was completely wrong on this one.
display: contents
doesn't have any effect on inheritance, so my suggestion broke styling.