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

feat(tile): add design tokens #10476

Merged
merged 35 commits into from
Oct 25, 2024
Merged

feat(tile): add design tokens #10476

merged 35 commits into from
Oct 25, 2024

Conversation

eriklharper
Copy link
Contributor

@eriklharper eriklharper commented Oct 2, 2024

Related Issue: #7180

Summary

Adds design tokens for the Tile component.

--calcite-tile-accent-color-press: When the parent calcite-tile-group has a selectionMode that is not "none", specifies the color of the component's selection elements, such as the radio, checkbox, and border.
--calcite-tile-background-color: Specifies the component's background color.
--calcite-tile-border-color: Specifies the component's border color.
--calcite-tile-corner-radius: Specifies the component's corner radius.
--calcite-tile-heading-text-color: Specifies the component's heading text color.
--calcite-tile-link-color: When the href property exists, specifies the color of the component's link elements, such as the border, icon and heading text on hover, focus and press.
--calcite-tile-shadow: Specifies the shadow around the component.
--calcite-tile-text-color: Specifies the component's description and icon text color, but not the heading text color.

@github-actions github-actions bot added the enhancement Issues tied to a new feature or request. label Oct 2, 2024
@eriklharper eriklharper marked this pull request as ready for review October 2, 2024 22:48
@eriklharper eriklharper requested review from alisonailea and jcfranco and removed request for jcfranco and benelan October 2, 2024 22:48
Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Erik! Looking good. I have a few suggestions to ensure we keep the component aligned to current design patterns.

@ashetland can you confirm "heading" "description/text" align with the future cross-component heading patterns?

packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
}
}

:host([selection-appearance="border"][layout="vertical"]) {
.container.selected {
box-shadow: inset 4px 0 0 0 var(--calcite-color-brand);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only the "x" and "y" axis lengths are in changing between these box-shadows. You could probably simplify this down to a single style prop. Something like....

.container {
  box-shadow: inset var(--calcite-internal-tile-shadow-x) var(--calcite-internal-tile-shadow-y) 0 0 var(--calcite-internal-tile-shadow-color, none);
}

:host([selection-appearance="border"]) .container.selected { 
  --calcite-internal-tile-shadow-color: var(--calcite-tile-color-selected, var(--calcite-color-brand));
}

:host([layout="vertical"]) .container {
  --calcite-internal-tile-shadow-x: 4px;
  --calcite-internal-tile-shadow-y: 0;
}

:host([layout="horizontal"]) .container {
  --calcite-internal-tile-shadow-x: 0;
  --calcite-internal-tile-shadow-y: -4px;
}

packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
packages/calcite-components/src/components/tile/tile.scss Outdated Show resolved Hide resolved
…xt-color-hover" token to allow both a default and overridable hover color.
…ender this unnecessary and we don't want to ship a token we'll have to immediately deprecate
…so that one color token controls both the unfocused and focused states
…irectly on a calcite-tile element selector in CSS
… Restoring selection-appearance border selected styles with box-shadow rules.
…internal-tile-border-color and using brand token for hover, focus states on borders
…way of setting the color of the presentation calcite-icon using a direct color property, and adding additional --calcite-tile-href-icon-color-hover token that defaults to the link color
…le-description-text-color, syncing up all current css properties in tests and demos, commenting out some tests that need fixed in a follow-up
…ption-text-color-hover token with correct fallback, refactoring icon selectors to use css classes instead of element selectors, fixing heading text hover color, updating tests and demos, adding a link token test for heading text and icon hover
…cite-tile-selection-color/hover just like Card does.
@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Oct 21, 2024
@eriklharper eriklharper removed the Stale Issues or pull requests that have not had recent activity. label Oct 24, 2024
Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good Eric! Just a few things

Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 🚢

@eriklharper eriklharper added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Oct 25, 2024
@eriklharper eriklharper merged commit 3c338eb into dev Oct 25, 2024
13 checks passed
@eriklharper eriklharper deleted the eriklharper/7180-tile-tokens branch October 25, 2024 21:04
@github-actions github-actions bot added this to the 2024-10-29 - Oct Milestone milestone Oct 25, 2024
benelan added a commit that referenced this pull request Oct 25, 2024
…orepo

* origin/dev:
  build(deps): update typescript-eslint monorepo to v7.18.0 (#10593)
  feat(tile): add design tokens (#10476)
  deprecate: deprecate web-adaptor in favor of web-adapter (#10598)
  docs: update component READMEs (#10600)
  build(deps): update dependency @rollup/plugin-replace to v6 (#10604)
  chore: release main (#10597)
  ci(chromatic): build storybook even when skipping snapshots (#10589)
  build(deps): update dependency axe-core to v4.10.1 (#10566)
  ci: add calcite-ui-icons label to relevant package PRs (#10590)
  chore: release next
  feat: add buffer point, buffer polygon, buffer polyline, contour, offset (#10594)
  feat(input-date-picker, date-picker): improve date picking experience (#8402)
  chore: release next
  fix: updated web-adapter name (#10581)
  build(deps): update nrwl monorepo to v19.8.6 (#10575)
  build(deps): update dependency tsx to v4.19.1 (#10574)
  build(deps): update dependency @cspell/eslint-plugin to v8.15.4 (#10565)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants