Closed elrayle closed 8 years ago
@elrayle So I'm guessing that since the save/visibility widget is using these classes and the layout for it is different than for collections we're getting the difference in display? I'm pulling the latest to take a look.
I'm see this:
@mtribone Are you saying you can't reproduce this bug?
@mjgiarlo Yeah, I'm not quite sure of what @elrayle is experiencing without a screen shot. I see the alignment above.
The issues is not that the current style on the page is wrong, but that we're adjusting it 2-3 different ways in the CSS. Can we make it a SASS mixin and reuse it?
@jcoyne Okay. @elrayle has it listed as a bug and the behavior described in her issue lead me to look for a display issue. If it is just a refactoring ticket, can the issue be reworked to reflect what is needed?
Yes, I believe technical debt
is the correct tag for this, not bug
I'm working on this.
Great, @jenlindner, thanks! You should be able to add yourself as the assignee (over on the right) once you accept the invitation to join the projecthydra GitHub org. Maybe it got filtered to your spam/junk mail.
In the meantime, I'm going to assign this issue to me so folks know this one is taken. Once you've accepted the GitHub invitation, feel free to take this issue away from me. :)
So, there's a style in CC that looks like it was intended to provide the left-right padding for this, but it wasn't included in sufia (#set-access-controls & > .form-group). I explicitly imported it, and also altered the selector to apply to any form group, not just a direct child (the markup in sufia has the form group under one extra tag). And this works and allows for the classes in sufia adding extra padding to be deleted.
Not sure if this is the way to solve this problem, though it seems close.
Tagging @projecthydra/sufia-ui-ux-advisors to see if they have any input. Thanks, @jenlindner
@jenlindner Can you push your branch, so that we can get a sense of what has been removed/added from Sufia? There were two CSS files referenced in Lynette's issue at the top and I'd like to see how your solution addresses her observations.
Sure, one sec. It's called 1987_tech_debt.
And I changed line 43 in CC app/assets/stylesheets/curation_concerns/modules/forms.scss to this:
& .form-group { padding: 0 1.75em; }
I still need to do a little checking into what the .visibility class is used for besides padding in Sufia.
Yeah wondering if we need any of the form group declarations in those style sheets (form_progress and collections) if you've made the fix in CC and imported it into Sufia?
I'll check it out without them.
I don't think that CC should be customizing the padding in those locations. Bootstrap provides good defaults for padding out elements. If we don't write custom paddings in CC and just use Bootstrap Sufia will look better and it will be easier to overwrite.
I'd already taken them out.
As for visibility, it looks like this line: new VisibilityComponent(this.element.find('.visibility'))
in save_work_control.es6 is referring to this markup in the _form_visibility_component partial, both in Sufia:
@justcolin Sufia doesn't inherit these styles from CC.
Sorry for the confusion, I was thinking of a related styling thing that I've been looking at.
So, the tech debt was created by Sufia copying the #set-access-controls & < .form-group style from CC (https://github.com/projecthydra-labs/curation_concerns/blob/master/app/assets/stylesheets/curation_concerns/modules/forms.scss#L41-L60) and writing a few new ones when it didn't quite work (because of one extra enclosing tag in the Sufia form).
These are the copy and new style:
My fix was to alter the CC style slightly so that it applies to any form-group and @import it. The 1 .form-progress.form-group copied from CC did the same thing (but with the selector that didn't work with the extra tag), so I removed it, and got rid of the extra declarations used to add 20 px of left padding.
Thoughts?
Using the #set-access-controls id also fixes the visibility radios in the batch create and new work views.
Could you also add some classes to the HTML so we can make those selectors less specific? The id
plus all of those classes will make overwriting those styles a bit onerous.
I was working under the assumption that I should change as little as possible in general, just remove and clean up what could be removed. But definitely #set-access-controls would be better off as a class. I'll do that and push up a branch here and in CC shortly.
My main question though is is it okay to make this change in CC and then import the forms.scss module into Sufia? Seems the right way to go to me but I'm obviously completely new to these projects.
the branches were pushed.
Descriptive summary
form_group class is shifted left and there are several kludges in stylesheets to shift items back to the right. It is unknown why the shift left occurred in the first place and what impact it would have to unshift the source definition.
Expected behavior
For http://localhost:3000/collections/new, the radio buttons for visibility should be on the screen. They are with the padding to shift right.
Actual behavior
Steps to reproduce the behavior
Known styles that are right shifted:
There are likely others as well.
Related work
PR #1975