Skip to content

feat: add appearance and deprecate ondark #304#306

Merged
sun-mota merged 1 commit into
devfrom
sunMota/replacing-ondark
Oct 15, 2025
Merged

feat: add appearance and deprecate ondark #304#306
sun-mota merged 1 commit into
devfrom
sunMota/replacing-ondark

Conversation

@sun-mota

@sun-mota sun-mota commented Oct 3, 2025

Copy link
Copy Markdown
Member

Alaska Airlines Pull Request

Close #304

This is to replace onDark attr with surface attr.

  • Adding surface with its default value light
  • Mark onDark as deprecated in the api table
  • Replace onDark with surface="dark" in all examples

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Introduce a new appearance attribute to control light or dark styling and deprecate the ondark flag across the hyperlink component.

New Features:

  • Add appearance property with default value 'default' to replace ondark.

Enhancements:

  • Update component base and styles to use appearance for theme variants while marking ondark as deprecated.
  • Adjust hyperlink rendering logic to reflect appearance and maintain backward compatibility with ondark.

Documentation:

  • Revise API documentation and all example files to replace ondark with appearance="inverse" and note deprecation of ondark.

Chores:

  • Bump devDependencies for @aurodesignsystem/auro-button and @aurodesignsystem/auro-icon.

@sun-mota sun-mota self-assigned this Oct 3, 2025
@sun-mota sun-mota linked an issue Oct 3, 2025 that may be closed by this pull request
@sourcery-ai

sourcery-ai Bot commented Oct 3, 2025

Copy link
Copy Markdown

Reviewer's Guide

Introduce a new appearance attribute with default and inverse variants to replace ondark, deprecate ondark in the API and code, update styling and examples to use appearance, and bump relevant dependencies.

Class diagram for updated hyperlink component attributes

classDiagram
    class ComponentBase {
        +String appearance = 'default'
        +Boolean ondark (deprecated)
        +Boolean download
        +Boolean relative
        +String href
        +String referrerpolicy
        +String rel
        +Boolean fluid
        +String role
        +String safeUri
        +String target
        +String type
        +String variant
    }
    class AuroElement {
        +String appearance = 'default'
        +String lang
    }
    class AuroHyperlink {
        +String appearance
        +Boolean ondark (deprecated)
        +String type
        +String variant
        +String role
        +String safeUri
        +Boolean fluid
        +String target
        +String href
        +String rel
        +String referrerpolicy
        +Boolean download
        +Boolean relative
    }
    ComponentBase <|-- AuroHyperlink
    AuroElement <|-- ComponentBase
Loading

File-Level Changes

Change Details Files
Introduce appearance attribute for surface styling
  • Add appearance default property and reflection to ComponentBase
  • Add appearance property declaration in AuroElement layout base
src/component-base.mjs
src/layoutElement/auroElement.js
Deprecate ondark attribute
  • Mark ondark as deprecated in the API documentation table
  • Annotate ondark with deprecation notice in JSDoc comments
docs/api.md
src/component-base.mjs
Support appearance in styling and rendering
  • Extend SCSS selectors to handle [appearance="inverse"] alongside ondark
  • Update hyperlink class logic to derive inverse mode from appearance
src/styles/color.scss
src/auro-hyperlink.js
Replace example usages of ondark with appearance="inverse"
  • Update all HTML example files to use appearance="inverse" instead of ondark
apiExamples/cta-ondark.html
apiExamples/cta-external-link-ondark.html
apiExamples/navPattern-ondark.html
apiExamples/basic-ondark.html
apiExamples/external-ondark.html
apiExamples/external-referrer-ondark.html
apiExamples/navStyle-ondark.html
apiExamples/roleButton-ondark.html
apiExamples/cta-shape.html
Bump devDependencies patch versions
  • Update @aurodesignsystem/auro-button to ^12.1.0
  • Update @aurodesignsystem/auro-icon to ^9.1.0
package.json

Assessment against linked issues

Issue Objective Addressed Explanation
#304 Replace the 'ondark' attribute with a new attribute ('appearance' or 'surface') for indicating component background styling.
#304 Deprecate the 'ondark' attribute in the API and documentation, clearly indicating to use the new attribute instead.
#304 Update all code examples and usages to use the new attribute ('appearance' or 'surface') instead of 'ondark'.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions

github-actions Bot commented Oct 3, 2025

Copy link
Copy Markdown

Surge demo deployment failed! 😭

@sun-mota
sun-mota force-pushed the sunMota/replacing-ondark branch 3 times, most recently from 48a878e to 2659023 Compare October 6, 2025 19:32
@sun-mota
sun-mota force-pushed the sunMota/replacing-ondark branch from 2659023 to 841c04b Compare October 13, 2025 19:08
@sun-mota
sun-mota marked this pull request as ready for review October 13, 2025 19:11
@sun-mota
sun-mota requested a review from a team as a code owner October 13, 2025 19:11

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `src/auro-hyperlink.js:117` </location>
<code_context>
       hyperlink: this.safeUri || this.role,
       "hyperlink--nav": this.type === "nav",
-      "hyperlink--ondark": this.ondark,
+      'hyperlink--ondark': this.appearance === 'inverse' || this.ondark,
       "hyperlink--button": this.role,
       "hyperlink--secondary": this.variant === "secondary",
</code_context>

<issue_to_address>
**issue (bug_risk):** Combining 'appearance' and 'ondark' may cause ambiguous styling.

If both 'appearance' and 'ondark' are set, clarify which should take precedence or add a warning to prevent conflicting states.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sun-mota
sun-mota force-pushed the sunMota/replacing-ondark branch from 0769650 to 841c04b Compare October 13, 2025 19:13
@sun-mota
sun-mota changed the base branch from main to dev October 13, 2025 19:13
@sun-mota
sun-mota force-pushed the sunMota/replacing-ondark branch from 841c04b to 95aa27d Compare October 13, 2025 19:26
@github-actions

github-actions Bot commented Oct 13, 2025

Copy link
Copy Markdown

🚀 PR Release Published! v0.0.0-pr306.1

To install:

npm install @aurodesignsystem-dev/auro-hyperlink@0.0.0-pr306.1

Install via alias:

npm install @aurodesignsystem/auro-hyperlink@npm:@aurodesignsystem-dev/auro-hyperlink@0.0.0-pr306.1

View on npmjs.com

@jordanjones243 jordanjones243 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Change name of ondark files and this PR is good to go

@sun-mota
sun-mota force-pushed the sunMota/replacing-ondark branch from 95aa27d to 20bfff6 Compare October 15, 2025 18:00
@sun-mota
sun-mota merged commit 8c01707 into dev Oct 15, 2025
16 checks passed
@sun-mota
sun-mota deleted the sunMota/replacing-ondark branch October 15, 2025 18:03
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.0.0-rc-309.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released Completed work has been released label Oct 17, 2025
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.0.0-rc-320.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.0.0-rc-329.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 7.0.0-rc-336.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions

github-actions Bot commented May 1, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 7.0.0-rc-339.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace ondark attribute

2 participants