Skip to content

Conversation

@dvoituron
Copy link
Collaborator

[FluentButton] Update the custom Button style for the BackgroundColor and Color properties.

  1. Remove the custom-id attribute to use the default id attribute (if not set, a default value is assigned).
  2. Use the `InlineStyleBuilder' utility to create an inline custom style like this.
<FluentButton BackgroundColor="#ff0000" Color="#00ff00">My button</FluentButton>

will generate...

<style>
  #f7e40a894::part(control) { background: padding-box linear-gradient(#ff0000, #ff0000), border-box #ff0000; color: #00ff00; }
  #f7e40a894::part(control):hover { opacity: 0.8; }
</style>

<fluent-button type="button" id="f7e40a894">My button</fluent-button>

Copy link
Collaborator

@vnbaaij vnbaaij left a comment

Choose a reason for hiding this comment

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

Nice!

@vnbaaij vnbaaij merged commit fdcf547 into dev Feb 28, 2024
@vnbaaij vnbaaij deleted the users/dvoituron/button-style-colors branch February 28, 2024 11:20
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.

3 participants