Skip to content
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

Included component for an icon with a circle around it, in small, med… #21

Merged
merged 5 commits into from
Nov 2, 2016

Conversation

jgiardino
Copy link

Addresses icon with circle

Summary of changes:

  • Included parameter in icon component for adding a decorator class, which in this case is one of the following classes:
    • pficon-circle-sm
    • pficon-circle-md
    • pficon-circle-lg

@jgiardino
Copy link
Author

When updates in _pf-basic-icons.scss are included in patternfly.css, do I also check in patternfly.css, or only _pf-basic-icons.scss? I excluded patternfly.css from my checkin since I wasn't sure.

}
.pficon-circle-md {
@include pficon-circle(54px, 23px, 50px);
}
Copy link
Member

Choose a reason for hiding this comment

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

I like calculating based on rem or maybe actually em? Why not do that for -lg and -md?

Copy link
Author

Choose a reason for hiding this comment

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

I thought about that. I would need to use specific rem values instead of variables like $font-size-relative-lg. What does everyone think?

@srambach
Copy link
Member

srambach commented Nov 1, 2016

This looks nice. Code looks good on inspection but I haven't tried it out.

@@ -219,3 +219,12 @@
.#{$pf-icon-prefix}-zone:before {
content: $pficon-var-zone;
}
.pf-icon-circle-lg {
Copy link
Member

Choose a reason for hiding this comment

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

For our class names we'll use BEM, following the structure: {{pf-block}}__{{element}}--{{modifier}}
The size is a modifier, but is circle and element?
@jgiardino @srambach: what do you think? ?

Copy link
Member

Choose a reason for hiding this comment

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

Good call. I think circle is a modifier of icon.

Copy link
Member

@andresgalante andresgalante Nov 1, 2016

Choose a reason for hiding this comment

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

Oh, yes! I've haven't though it that way. If we decouple them `pf-icon--circleandpf-icon--lg``and``pf-icon-sm``. then we'll make it even more modular.
What do you think?

Copy link
Author

Choose a reason for hiding this comment

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

I agree that circle is a modifier. And I wasn't sure about the use of double dashes, is that something I should include?

I like the idea of separating icon size from the circle. I think that would look like this:

.pf-icon--circle {
width: calc(2em + 4px);
height: calc(2em + 4px);
line-height: 2em;
text-align: center;
border: 2px solid $color-pf-blue-300;
border-radius: 50%;
}
.pf-icon--lg {
font-size: $icon-size-lg;
}
.pf-icon--md {
font-size: $icon-size-md;
}

I don't think this is necessary:
.pf-icon--base {
font-size: $font-size-relative-base;
}

Copy link
Member

Choose a reason for hiding this comment

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

👍 excellent and I agree that --base is not neccesary

@jgiardino
Copy link
Author

@andresgalante @srambach Let me know if you have anymore suggestions. Thanks!

@srambach
Copy link
Member

srambach commented Nov 1, 2016

I like it even better now :-)

@andresgalante
Copy link
Member

I've tested and it looks great. Thanks @jgiardino great job!

The only thing I'd add is separate doc section for icon-size than icon-circle, following the way we show btns or pagination.

Or if we want to keep them together name the file 01-icon-variations and show examples for icons in different sizes with and without circles

…d examples of all combinations of modifier classes
…y fixing renaming file issue that popped up in the previous commit)
@andresgalante
Copy link
Member

@jgiardino thanks a lot, you are the best!

@andresgalante andresgalante merged commit 350c57d into patternfly:master Nov 2, 2016
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