Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Add more styling flexibility to chip#88

Merged
lgavillet merged 2 commits intomasterfrom
rn-add-flexibility-to-chip
Feb 1, 2017
Merged

Add more styling flexibility to chip#88
lgavillet merged 2 commits intomasterfrom
rn-add-flexibility-to-chip

Conversation

@ruinunes
Copy link
Contributor

Concerning component http://materializecss.com/chips.html
This adds scss variables for height, font-size, font-weight and line-height.

$chip-height: 32px !default;
$chip-line-height: 32px !default;
$chip-font-size: 13px !default;
$chip-font-weight: 500 !default;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the default library, no changes should be done here. Please move it there, if needed: app/assets/stylesheets/mtl/extend/_chips.scss

@ruinunes ruinunes force-pushed the rn-add-flexibility-to-chip branch from 95e38d4 to 3930f24 Compare January 27, 2017 14:37
$chip-height: 22px !default;
$chip-line-height: 23px !default;
$chip-font-size: .7rem !default;
$chip-font-weight: normal !default;
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. This is not the default values of Materialize https://github.com/Dogfalo/materialize/blob/master/sass/components/_chips.scss
  2. While checking the values, found that those values might be reported here: https://github.com/Dogfalo/materialize/blob/master/sass/components/_chips.scss#L14-L28 So, can you please update accordingly please?

@ruinunes ruinunes force-pushed the rn-add-flexibility-to-chip branch from 416e263 to a132d8c Compare January 30, 2017 19:23
@ruinunes
Copy link
Contributor Author

@lgavillet updated.

@lgavillet
Copy link
Contributor

Missing point 2 (about the images and close)

@ruinunes ruinunes force-pushed the rn-add-flexibility-to-chip branch from a014ac3 to a619f49 Compare January 30, 2017 22:54
@ruinunes
Copy link
Contributor Author

Thx. I've added changes affecting child elements.
As a try, experiment with some values, e.g.:
$chip-height and $chip-line-height to 100px
$chip-font-size: 24px

.close {
line-height: $chip-line-height;
font-size: $chip-font-size + 3px;
padding-left: $chip-height / 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Divided by 4, no..?

> img {
border-radius: $chip-border-radius;
height: $chip-height;
margin-right: $chip-height / 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

Divided by 4, no..?

font-weight: $chip-font-weight;
white-space: nowrap;
padding-right: $chip-height / 2;
> img {
Copy link
Contributor

Choose a reason for hiding this comment

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

an empty line?

margin-right: $chip-height / 5;
width: $chip-height;
}
.close {
Copy link
Contributor

Choose a reason for hiding this comment

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

empty line?

@lgavillet
Copy link
Contributor

Also possible to add something in CHANGES.md & REFERENCE.md files? To explain the additional configuration vars of the chips?

.close {
font-size: $chip-font-size + 3px;
height: $chip-height;
line-height: $chip-line-height;
Copy link
Contributor

Choose a reason for hiding this comment

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

here, shouldn't we add a padding-left as 1/4 of the font-size to keep the proper alignment, like we did in the img margin right? Asking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

went with padding-left: ($chip-font-size + 3px) / 2;

@ruinunes ruinunes force-pushed the rn-add-flexibility-to-chip branch 2 times, most recently from 3ca6022 to 27142b9 Compare January 31, 2017 13:30
@lgavillet lgavillet force-pushed the rn-add-flexibility-to-chip branch from de41ce3 to 596b2ba Compare February 1, 2017 21:18
@lgavillet lgavillet merged commit 40331f4 into master Feb 1, 2017
@lgavillet lgavillet deleted the rn-add-flexibility-to-chip branch February 1, 2017 21:28
$chip-font-size: 13px !default;
$chip-font-weight: 500 !default;
$chip-border-radius: 500px !default;
$chip-border-radius: 16px !default;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants