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

Add pt-fill support to file upload #826

Merged
merged 2 commits into from
Mar 13, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/core/src/components/forms/_file-upload.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ Wrap that all in a `label` with class `pt-file-upload`.
</div>

Markup:
<label class="pt-file-upload">
<label class="pt-file-upload {{.modifier}}">
<input type="file" {{:modifier}}/>
<span class="pt-file-upload-input">Choose file...</span>
</label>

:disabled - Disabled
.pt-fill - Take up full width of parent element

Weight: 10

Expand Down Expand Up @@ -88,7 +89,8 @@ Styleguide components.forms.fileupload
border-radius: $pt-border-radius;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
width: $pt-grid-size * 7;
// compensating for the negative margin-left above
width: $pt-grid-size * 7 + $button-border-width;
Copy link
Contributor

Choose a reason for hiding this comment

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

add a variable for this $upload-button-width, see line 74 above.

height: $pt-input-height;
padding: 0 $pt-grid-size;
text-align: center;
Expand Down Expand Up @@ -121,4 +123,8 @@ Styleguide components.forms.fileupload
}
}
}

&.pt-fill {
width: 100%;
}
}