[Enhancement] Use part
html attribute to make styling easier
#7353
Labels
ArcGIS Maps SDK for JavaScript
Issues logged by ArcGIS SDK for JavaScript team members.
calcite-components
Issues specific to the @esri/calcite-components package.
enhancement
Issues tied to a new feature or request.
has workaround
Issues have a workaround available in the meantime.
Check existing issues
Description
A
part
html attribute exists to allow developers using web components to style elements in shadow DOM.Calcite does not appear to be using it at all at the moment.
Acceptance Criteria
part
andexportparts
html attributes are utilized generously in Calcite web components to make styling easierAlternatively, add more css variables and props to give more control of web component internals
Relevant Info
Stencil docs:
MDN docs:
Which Component
I need this in
<calcite-action>
and<calcite-slider>
at the moment, but theoretically in all componentsExample Use Case
I am using
<calcite-action>
and<calcite-slider>
inside of<calcite-action-group>
.I need to add border radius for the 4 edge buttons of the d-pad and the slider (can't simply add border radius to
<calcite-action-group>
as that will cut off the focus outline)I wish to add a style like this to only have focus outline when using keyboard:
I need to disable the margin on the slider div container.
The
calcite-action > button
has padding-inline and padding-block values that don't match:As a result, when I put actions in a 3x3 grid, the grid is shaped like a rectangle rather than a square
At the moment, I solve these issues by injecting my styles into the web component by creating a
<style>
tag inside of it using JavaScript, but that solution is hacky and fragile:Priority impact
p3 - want for upcoming milestone
Calcite package
Esri team
ArcGIS Maps SDK for JavaScript
The text was updated successfully, but these errors were encountered: