Skip to content
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

--calcite-input-message-spacing-value var not inheritable #10620

Open
2 of 6 tasks
nwhittaker opened this issue Oct 25, 2024 · 0 comments
Open
2 of 6 tasks

--calcite-input-message-spacing-value var not inheritable #10620

nwhittaker opened this issue Oct 25, 2024 · 0 comments
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. design-tokens Issues requiring design tokens. estimate - 2 Small fix or update, may require updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - medium Issue is non core or affecting less that 60% of people using the library

Comments

@nwhittaker
Copy link
Contributor

Check existing issues

Actual Behavior

<calcite-input-message> elements retain their default top margin if --calcite-input-message-spacing-value is not set directly on the element, but rather on an ancestor element.

Expected Behavior

<calcite-input-message> elements assume the top margin as set by --calcite-input-message-spacing-value regardless if the var is set directly or on an ancestor element.

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/KKOZKYx

Reproduction Steps

  1. Visit the sample and observe the input-message is aligned to the top rather than half-way down the preview area.
  2. In the CSS section, uncomment where --calcite-input-message-spacing-value is set directly on the input-message element.
  3. Compare the element's positioning with its positioning from step 1. After fixing the bug, they should be the same.

Reproduction Version

2.13.1

Relevant Info

Minimally preferring the var() function's fallback value should work well here:

--calcite-input-message-spacing-value: theme("spacing.1");
margin-block-start: var(--calcite-input-message-spacing-value);

-  --calcite-input-message-spacing-value: theme("spacing.1");
-  margin-block-start: var(--calcite-input-message-spacing-value);
+  margin-block-start: var(--calcite-input-message-spacing-value, theme("spacing.1"));

Possibly worth auditing other components to make sure their CSS vars are inheritable.

Regression?

No response

Priority impact

impact - p2 - want for an upcoming milestone

Impact

Impact is towards dev productivity and maintainability. The expectation is that CSS is inherently cascading. When that doesn't happen, it's unexpected and takes time to debug. Maintenance-wise, given a collection of elements that should be treated uniformly, it's a better practice to set common styles/vars on a shared ancestor rather than every leaf element.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-angular
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Oct 25, 2024
@nwhittaker nwhittaker changed the title --calcite-input-message-spacing-value var is not inheritable --calcite-input-message-spacing-value var not inheritable Oct 25, 2024
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. calcite-components Issues specific to the @esri/calcite-components package. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone labels Oct 25, 2024
@geospatialem geospatialem added p - medium Issue is non core or affecting less that 60% of people using the library estimate - 2 Small fix or update, may require updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. design-tokens Issues requiring design tokens. and removed needs triage Planning workflow - pending design/dev review. labels Nov 12, 2024
@DitwanP DitwanP added this to the 2025-04-29 - Apr Milestone milestone Jan 3, 2025
@DitwanP DitwanP removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - new New issues that need assignment. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. calcite-components Issues specific to the @esri/calcite-components package. design-tokens Issues requiring design tokens. estimate - 2 Small fix or update, may require updates to tests. impact - p2 - want for an upcoming milestone User set priority impact status of p2 - want for an upcoming milestone p - medium Issue is non core or affecting less that 60% of people using the library
Projects
None yet
Development

No branches or pull requests

3 participants