-
Notifications
You must be signed in to change notification settings - Fork 313
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: add theming feature to elements #3821
Conversation
959d43a
to
1d83ce3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to delete this https://github.com/box/box-ui-elements/blob/master/src/styles/theme.js or at least remove it from storybook or mark it as deprecated this way the customer is not confused?
@@ -1269,6 +1272,7 @@ class ContentUploader extends Component<ContentUploaderProps, State> { | |||
<TooltipProvider> | |||
{useUploadsManager ? ( | |||
<div ref={measureRef} className={styleClassName} id={this.id}> | |||
<ThemingStyles selector={`#${this.id}`} theme={theme} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can have a VRT for this since we know this component should be able to apply a theme. at least we can verify the feature is working at a high level?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I have a separate ticket for adding demos and I can include the VRTs in that
no this theming is still used in EUA and I'm guessing Admin console as well. it's how components that haven't been migrated to Blueprint use custom branding in the webapp. |
I think we should ensure customers dont try to use this one by at least saying its been deprecated or removing the story for it. what do you think? |
yeah I can remove the storybook and styleguidist related to theming. i'm not sure about deprecation warnings though since it'll also effect EUA developers for however long. we'll probably have to do that closer to when EUA has fully migrated to blueprint. btw this new feature doesn't replace the existing theming stuff in buie, they handle separate use cases. the existing theme work is for internal apps while the new theme work is for ui elements |
then just removing it from the documentation is enough |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approval with the VRTs being done in another pr and testing of the useCustomTheming hook to also be covered by the VRTs and if not there should be a unit test to cover it separately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This pull request has been removed from the queue for the following reason: The merge conditions cannot be satisfied due to failing checks: You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
This pull request has been removed from the queue for the following reason: Pull request #3821 has been dequeued. The pull request rule doesn't match anymore You should look at the reason for the failure and decide if the pull request needs to be fixed or if you want to requeue it. If you want to requeue this pull request, you need to post a comment with the text: |
@tjuanitas can this new theming support be used to provide custom icons in the ContentExplorer? Our use case, for example, is providing custom icons for folder items. |
hello @mtucker! this PR is specific to CSS styles and does not include icons. however, this is good feedback. few questions:
|
thanks for your replay @tjuanitas!
We're customizing the look and feel of the ContentExplorer in order to better align with our product's design system. We've done this primarily by overriding CSS but replacing icons has been tricky because item icons don't appear to have specific classes we can target.
We're currently only interested in overriding the folder icons but a more general solution might come in handy down the road.
I like the idea of using the theme to override based on design tokens. We are embedding the Love the addition of this theming option! |
This change adds a new component
ThemingStyles
to the root of the elements to enable customers to configure theming for components that utilize Blueprint.ThemingStyles
expands on Blueprint'sBrandingStyles
implementation and allows developers to overwrite any blueprint tokens using a configuration object.theme
object which will be transformed into CSS properties that are scoped to the element:The structure of the passed theme configuration object is not strict and allows for different structured inputs providing the same output. The intended structure is based on how our internal design team defines the levels of the tokens but users can also provide a flattened structure if preferred. DevRel will provide a template theme configuration that customers can modify in order to utilize this feature. In the future, there are goals to build a theme builder that will help developers build a config through a user interface.
Reference: https://www.npmjs.com/package/@box/blueprint-web-assets
/@box/blueprint-web-assets/tokens/tokens-css-vars.scss
/@box/blueprint-web-assets/tokens/tokens.scss