Comments (3)
Closed by #4512
from components.
Hi! Thanks for taking the time!
Currently, we are using css selectors to override some of the styles (which seems a little hacky) and thought it would be helpful we could pass styles using a prop.
I see TreeView doesn't support sx for all the child items. This was partially intentional at the time of building it so that the design does not deviate too much. The use cases however are many and varied now (like NestedListView!)
We want to phase out styling through a prop (sx) over time, so I would recommend using classNames. However, TreeView does not have reliable selectors that you can target yet. Would that be a useful change for you?
from components.
@siddharthkp I think a good solution would be to support custom styling on TreeView
and TreeView.Item
. That could be via the sx
prop or className
prop (or maybe both for this in-between time).
However, TreeView does not have reliable selectors that you can target yet.
I think we should probably avoid getting into the habit of exposing targetable selectors, because it makes things difficult to change. Long term, it will make it harder for PRC to move to CSS Modules because the class names would need to remain static.
If there's specific things we want to support styling internally, I think we should either add props for the required variants, like hideNestingIndicators
, or we should add support for more externally defined classnames rather than defining new internal classnames. This could look like a new nestingIndicatorClassName
prop or maybe even a whole new standard PRC pattern where we have an internalClassNames
prop that accepts an object: <TreeView.Item internalClassNames={{nestingIndicator: styles.hidden}} />
Or, one more option might be to set data-
attributes for selection instead of classes, which preserves encapsulation. But I think we'd want to document those and personally I'd prefer some props-based approach that can be typechecked vs an approach that requires more complex CSS selectors.
from components.
Related Issues (20)
- Enhancement: Add support for flush action lists HOT 2
- Update docs for `Button` to not consider `count` as required HOT 1
- Release Tracking
- Using `TooltipV2` always sets aria associations on first child element HOT 11
- [Tests] Ensure that axe calls are made on open state of the component HOT 4
- [TreeView] Add area for `dragHandle` to be shown before the expand/collapse toggle HOT 1
- Release Tracking
- `Stack` `justify` prop has no effect HOT 4
- SelectPanel2 Optimization: Do not add and remove keydown listener for escape key on every render HOT 1
- `Stack` `gap` is overridden on wider layouts
- Release Tracking
- Portal Hardcoded Z-Index Buries Components HOT 2
- Consider modern `moduleResolution`
- Data Table Pagination - when the page numbers in the 1000s the page numbers are unreadable HOT 1
- Dockerize The entire application HOT 1
- [ActionMenu.Button] onClick doesn't function HOT 8
- "npm run setup" doesn't exist in your package.json HOT 1
- Inline `ActionList.Description` can result in horizontal overflow
- RICKYYYC
- <UnderlineNav.Item /> without counter shows loading indicator HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from components.