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(styles): tokenize the Link component styles #3590

Merged
merged 34 commits into from
Oct 16, 2024

Conversation

alionazherdetska
Copy link
Contributor

No description provided.

@alionazherdetska alionazherdetska requested a review from a team as a code owner September 26, 2024 08:44
@alionazherdetska alionazherdetska linked an issue Sep 26, 2024 that may be closed by this pull request
5 tasks
Copy link

changeset-bot bot commented Sep 26, 2024

🦋 Changeset detected

Latest commit: 531b418

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@swisspost/design-system-styles Minor
@swisspost/design-system-documentation Minor
@swisspost/design-system-components-angular-workspace Patch
@swisspost/design-system-components Minor
@swisspost/internet-header Patch
@swisspost/design-system-intranet-header-workspace Patch
@swisspost/design-system-nextjs-integration Patch
@swisspost/design-system-styles-primeng-workspace Patch
@swisspost/design-system-intranet-header Minor
@swisspost/design-system-styles-primeng Minor
@swisspost/design-system-components-react Minor
@swisspost/design-system-components-angular Minor
@swisspost/design-system-intranet-header-showcase Patch
@swisspost/design-system-tokens Minor
@swisspost/design-system-icons Minor
@swisspost/design-system-migrations Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@swisspost-bot
Copy link
Contributor

swisspost-bot commented Sep 26, 2024

Related Previews

@alionazherdetska alionazherdetska changed the title [component]: Text link feat(styles): tokenize the Link component styles Sep 26, 2024
Copy link
Contributor

@alizedebray alizedebray left a comment

Choose a reason for hiding this comment

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

Good job 👍
Do not hesitate to contact me if one of my comments is not clear

packages/styles/src/elements/link.scss Outdated Show resolved Hide resolved
packages/styles/src/elements/link.scss Outdated Show resolved Hide resolved
import { MetaComponent } from '@root/types';

const meta: MetaComponent = {
id: 'link-component',
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually use random UUID here, you can generate one on this website for axample: https://www.uuidgenerator.net/

Use links to navigate users to another location, such as a different site, resource, or section within the same page.
</div>

Apply the override classes for custom styling as needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I get this sentence, what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

When you create a new snapshot file you also need to create the matching visual regression test here: https://github.com/swisspost/design-system/tree/main/packages/documentation/cypress/snapshots/components

<div>
${['bg-white', 'bg-dark'].map(
bg => html`
<div class="${bg} d-flex flex-column gap-regular p-regular mt-regular">
Copy link
Contributor

Choose a reason for hiding this comment

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

Here you also have to set a data-color-mode="light" or data-color-mode="dark" attribute so that the correct set of token is used.

Copy link
Contributor

@oliverschuerch oliverschuerch left a comment

Choose a reason for hiding this comment

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

Please relocate this component so it appears under "Foundations/Typography/Link"!
And also move the files.

.changeset/lazy-gorillas-admire.md Outdated Show resolved Hide resolved
packages/styles/src/elements/link.scss Outdated Show resolved Hide resolved
@alionazherdetska
Copy link
Contributor Author

alionazherdetska commented Oct 10, 2024

I have used the same hover effect for the high contrast mode (increased the thickness of text decoration) as on:
https://www.w3.org/TR/css-color-4/#css-system-colors

Screenshot 2024-10-10 104930
Screenshot 2024-10-10 104941

Copy link
Contributor

Choose a reason for hiding this comment

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

This file should be added to the .gitignore file.

@alionazherdetska alionazherdetska force-pushed the 3424-component-text-link branch 2 times, most recently from f2ec933 to 1d74aae Compare October 15, 2024 13:27
packages/styles/src/elements/anchor.scss Outdated Show resolved Hide resolved

const meta: MetaComponent = {
id: '6f359d06-bca5-4983-b588-c8c790531642',
title: 'Typography/Link',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
title: 'Typography/Link',
title: 'Foundations/Typography/Link',

Copy link

@alionazherdetska alionazherdetska merged commit 283275b into main Oct 16, 2024
9 checks passed
@alionazherdetska alionazherdetska deleted the 3424-component-text-link branch October 16, 2024 13:28
gfellerph added a commit that referenced this pull request Oct 28, 2024
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

`main` is currently in **pre mode** so this branch has prereleases
rather than normal releases. If you want to exit prereleases, run
`changeset pre exit` on `main`.

⚠️⚠️⚠️⚠️⚠️⚠️

# Releases
## @swisspost/[email protected]

### Major Changes

- Switched stencil hydrated flag from class (`hydrated`) to attribute
(`data-hydrated`). This flag indicates when a component finished
rendering on the page. If your tests relied on the class being present,
please rewrite the selector to use the new attribute selector. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3783](#3783))

### Minor Changes

- Added the post-language-option component, a header component made to
enable users to select their preferred language. (by
[@alizedebray](https://github.com/alizedebray) with
[#3802](#3802))

- Added component `post-avatar` to show an avatar, based on different
possible input data (gravatar by email, initials by first- and/or
lastname, fallback). (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3352](#3352))

### Patch Changes

- Made the ´<post-popovercontainer>´ visually hidden for tooltips to fix
accessability issue. (by [@schaertim](https://github.com/schaertim) with
[#3619](#3619))

- Fixed the `post-card-control` label read twice by screen readers. (by
[@myrta2302](https://github.com/myrta2302) with
[#3625](#3625))

- Fixed an issue with property validation where some checks were run
before the framework had the chance to add computed properties (for
example Angular bindings like `[for]="$id"`). The checks are now delayed
to work around this issue. (by
[@gfellerph](https://github.com/gfellerph) with
[#3775](#3775))

-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Major Changes

- Removed deprecated accent colors (nightblue, petrol, coral, olive,
purple, aubergine and their light variations) and updated all relevant
components, documentation, and utilities. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3693](#3693))

- Removed deprecated grid container helper classes. (by
[@veyaromain](https://github.com/veyaromain) with
[#3527](#3527))

### Minor Changes

- Updated the Link component styles to align with the new design, added
a documentation page outlining the usage of the component. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3590](#3590))

- Updated the utility classes for opacity. (by
[@myrta2302](https://github.com/myrta2302) with
[#3754](#3754))

- Added a new App Store Badge component for promoting apps, supporting
both Google Play and Apple App Store badges. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3731](#3731))

- Added paragraph style. (by
[@bashirkarimi](https://github.com/bashirkarimi) with
[#3569](#3569))

### Patch Changes

- Updated margin styles according to the contribution guidelines.
Content elements like headings and paragraphs no longer have a margin
top if they're the first child and no margin bottom if they're the last
child in a container. (by [@gfellerph](https://github.com/gfellerph)
with [#3667](#3667))

## @swisspost/[email protected]

### Minor Changes

- Added component `post-avatar` to show an avatar, based on different
possible input data (gravatar by email, initials by first- and/or
lastname, fallback). (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3352](#3352))

### Patch Changes

- Fixed an issue with property validation where some checks were run
before the framework had the chance to add computed properties (for
example Angular bindings like `[for]="$id"`). The checks are now delayed
to work around this issue. (by
[@gfellerph](https://github.com/gfellerph) with
[#3775](#3775))
-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Minor Changes

- Added icons number 2613, 2614, 2615, 2616, 2617, 2618, 2619 and 2620.
(by [@gfellerph](https://github.com/gfellerph) with
[#3781](#3781))

- Added icons number 2621, 2622, 2623, 2624, 2625, 2626, 2627, 2628,
2629, 2630 and 2631. (by [@gfellerph](https://github.com/gfellerph) with
[#3832](#3832))

## @swisspost/[email protected]

### Patch Changes

- Fixed an issue with property validation where some checks were run
before the framework had the chance to add computed properties (for
example Angular bindings like `[for]="$id"`). The checks are now delayed
to work around this issue. (by
[@gfellerph](https://github.com/gfellerph) with
[#3775](#3775))
-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]



## @swisspost/[email protected]

### Major Changes

- Switched stencil hydrated flag from class (`hydrated`) to attribute
(`data-hydrated`). This flag indicates when a component finished
rendering on the page. If your tests relied on the class being present,
please rewrite the selector to use the new attribute selector. (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3783](#3783))

### Minor Changes

- Added and documented the possibility to create plain links in the main
navigation by adding noFlyout: true to the config. The flyout property
is now optional and can be omitted. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3596](#3596))

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Minor Changes

- Added the post-language-option component, a header component made to
enable users to select their preferred language. (by
[@alizedebray](https://github.com/alizedebray) with
[#3802](#3802))

- Updated the Accessibility documentation, reorganized in mutliple
folders and added Grouping Controls section (by
[@myrta2302](https://github.com/myrta2302) with
[#3638](#3638))

- Added component `post-avatar` to show an avatar, based on different
possible input data (gravatar by email, initials by first- and/or
lastname, fallback). (by
[@oliverschuerch](https://github.com/oliverschuerch) with
[#3352](#3352))

- Updated the Link component styles to align with the new design, added
a documentation page outlining the usage of the component. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3590](#3590))

- Updated the utility classes for opacity. (by
[@myrta2302](https://github.com/myrta2302) with
[#3754](#3754))

- Removed deprecated grid container helper classes. (by
[@veyaromain](https://github.com/veyaromain) with
[#3527](#3527))

- Added a new App Store Badge component for promoting apps, supporting
both Google Play and Apple App Store badges. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3731](#3731))

- Added paragraph element. (by
[@bashirkarimi](https://github.com/bashirkarimi) with
[#3569](#3569))

### Patch Changes

- Added and documented the possibility to create plain links in the main
navigation by adding noFlyout: true to the config. The flyout property
is now optional and can be omitted. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3596](#3596))

- Fixed the dropdown toggle in the example of the intranet header with a
navigation bar. (by [@alizedebray](https://github.com/alizedebray) with
[#3722](#3722))

- Updated the text of the Accessibility Forms Control Grouping section
and corrected the last example (by
[@myrta2302](https://github.com/myrta2302) with
[#3638](#3638))

- Removed class `hydrated` in stories because from now on we're using
the attribute `data-hydrated` to make components visible after
hydration. (by [@oliverschuerch](https://github.com/oliverschuerch) with
[#3783](#3783))

- Removed deprecated accent colors (nightblue, petrol, coral, olive,
purple, aubergine and their light variations) and updated all relevant
components, documentation, and utilities. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3693](#3693))

-   Updated dependencies:
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Minor Changes

- Added a new App Store Badge component for promoting apps, supporting
both Google Play and Apple App Store badges. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3731](#3731))

## @swisspost/[email protected]

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Patch Changes

-   Updated dependencies:
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]
    -   @swisspost/[email protected]

## @swisspost/[email protected]

### Patch Changes

- Removed deprecated accent colors (nightblue, petrol, coral, olive,
purple, aubergine and their light variations) and updated all relevant
components, documentation, and utilities. (by
[@alionazherdetska](https://github.com/alionazherdetska) with
[#3693](#3693))
-   Updated dependencies:
    -   @swisspost/[email protected]

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Philipp Gfeller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[component]: Text link
5 participants