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 button styles to add and delete #571

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

poofichu
Copy link
Contributor

Closes #556

image

@Snugug
Copy link
Member

Snugug commented Nov 18, 2016

@poofichu Styling thoughts for you:

  • Do we want delete to be that prominent, or do we want it to be similar to the cancel we have where it appears as a subdued link?
  • Do we want to keep the final delete and add on separate lines, or line them up together?
  • Is the placement for delete where we want it to be?

@Snugug Snugug changed the title Add button styles to add and delete 🆕 Add button styles to add and delete Nov 18, 2016
@Snugug Snugug changed the title 🆕 Add button styles to add and delete Add button styles to add and delete Nov 18, 2016
@poofichu
Copy link
Contributor Author

@ineedsubstance thoughts on the placement/button style of delete?

image

@ineedsubstance
Copy link
Contributor

@poofichu - I like this version where the delete action is secondary and the add is primary. Placement looks good. I do wish we could explore (maybe in the future), adding icons to the primary buttons. So in this case, adding a + icon to that button could be a nice addition. But overall, I like this approach.

@poofichu
Copy link
Contributor Author

@ineedsubstance Ask and you shall receive:

image

@ineedsubstance
Copy link
Contributor

@poofichu - Wow, nice! I like it. Makes it stand out a little more and puts more emphasis on the purpose of the button. As long as you are cool with it, let's roll with it.

JESSICA C. TREMBLAY added 2 commits November 18, 2016 14:19
…6-addbutton

 especially if it merges an updated upstream into a topic branch.
Update branch
@@ -0,0 +1,4 @@
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9.5 9.5">
Copy link
Member

Choose a reason for hiding this comment

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

Can we put this in src/images/icons please

Copy link
Member

Choose a reason for hiding this comment

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

And add all of the icon classes to this, please

background-image: url('/images/add.svg');
background-position: setting-get('rhythm') 49%;
background-repeat: no-repeat;
background-size: 9px;
Copy link
Member

Choose a reason for hiding this comment

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

Background size in em instead of px please. Generally don't use px

@include button(setting-get('primary accent color'), setting-get('primary accent color'), setting-get('primary color'), setting-get('primary accent color'), setting-get('primary color'), setting-get('primary color'), setting-get('primary color'));

background-image: url('/images/add.svg');
background-position: setting-get('rhythm') 49%;
Copy link
Member

Choose a reason for hiding this comment

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

Why is this 49%? Why not 50%? If it's because it doesn't vertically or horizontally center properly, use calc to nudge it in to the right position

&--add {
@include button(setting-get('primary accent color'), setting-get('primary accent color'), setting-get('primary color'), setting-get('primary accent color'), setting-get('primary color'), setting-get('primary color'), setting-get('primary color'));

background-image: url('/images/add.svg');
Copy link
Member

Choose a reason for hiding this comment

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

We aren't going to be able to guarantee that this background image is always going to be there. This should be an inline SVG in the HTML

Copy link
Member

Choose a reason for hiding this comment

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

If you have problems with that, extend https://github.com/punchcard-cms/punchcard/blob/master/lib/init/views.js like we did before

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Snugug So if we're going to add the svg to the html I need to do so in this file, yah?
https://github.com/punchcard-cms/content-types/blob/master/lib/form/html.js#L179

Can you do nunjucks partials in js files?

@scottnath
Copy link
Contributor

@poofichu are changes forthcoming this day, the day of monday, the day after a holiday, changes shall come forth, so be it and so it is said?

@poofichu
Copy link
Contributor Author

@scottnath going to work on this today! Problem we are having is how to inject the svg code for a plus icon for the add button instead of using it as a background image.

Copy link
Contributor

@scottnath scottnath left a comment

Choose a reason for hiding this comment

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

@poofichu so, the icon is now in css only and we're not putting it in the js or html. Is that what I'm seeing here?

Copy link
Member

@Snugug Snugug left a comment

Choose a reason for hiding this comment

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

A couple of code style thoughts, otherwise OK. If you could update those that'd be great. Thanks!


background-color: transparent;
border: {
left: 0 none;
Copy link
Member

Choose a reason for hiding this comment

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

If the width of all of these is 0 then they don't need their style set to none

&--add {
@include button(setting-get('primary accent color'), setting-get('primary accent color'), setting-get('primary color'), setting-get('primary accent color'), setting-get('primary color'), setting-get('primary color'), setting-get('primary color'));

background-image: url('/images/icons/add.svg');
Copy link
Member

Choose a reason for hiding this comment

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

This may be easier for us to read if image, position, repeat, and size were all nested under background like you're doing with border below

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.

4 participants