-
-
Notifications
You must be signed in to change notification settings - Fork 11
Add support for material-icons #40
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
Conversation
7970507
to
8455c92
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.
Great work. Left some minor comments for you to address.
8455c92
to
7b0a200
Compare
* Based on the npm https://github.com/marella/material-icons * All material icons as of 1.10.4 in an enum - ie: pie_chart -> PieChart("pie_chart") in MDCIconOpts.MDCIconType * Numbers written out using Proper Case 1MP -> OneMp * Output is a Span with the right class (Filled, Outlined, TwoTone, etc) * As elsewhere in KMDC, styling has to be applied externally
7b0a200
to
e9ff51a
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.
Almost there :)
As a side note, it would be good if you could stop force-pushing as it often messes up github links, even for linear history. Not a deal-breaker otherwise. |
*/ | ||
@MDCDsl | ||
@Composable | ||
public fun MDCIcon(opts: Builder<MDCIconOpts>? = null) { |
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.
Oof, missed it first time around, but since we're wrapping a single html element, it's always a good practice to expose attrs and content builder functions. Have a look at MDCButton for an example how it's done ;)
Sorry @mpetuska our internal workflow for branches is to force push them to keep the history clean. Would you prefer "fixup!" and "squash!" commits during the review process with a final rebase before merge, or do you prefer branches keep a simple linear history, mistakes and all? |
Well I'm squashing all commits when merging pr anyways to keep pr to commit ratio consistent on master. Not force-pushing to pr branches would make gh permalinks less flakey. But as I said before, this is not a deal breaker, but just my preference. |
ede65e2
to
dc91b33
Compare
@pocharlebois looks like you pushed a change I requested, but then overridden it with force-push (exactly why I'm not a fan of force-pushing anywhere :D). I've looked at the first push and it is forwarding attrs fine. One more thing that came to mind is new opt
This would allow people to change base element since mdc-icons supports both, <span> and <i> |
But I'm happy to ignore |
I suspect @pocharlebois would rather merge this as-is, and leave the |
PieChart("pie_chart") in MDCIconOpts.MDCIconType
Closes #33