The standard Button, Dropdown Button and Splitbutton have been implemented (see http://drupalcode.org/sandbox/ry5n/1932040.git/blob_plain/HEAD:/index.html). However, we need to add the Primary and Delete variants, and the Small variant (which should work when applied to any button). For reference, see http://groups.drupal.org/node/283223#Buttons and http://groups.drupal.org/node/283223#Small_Controls.
We may only need these two new variants for the .button class:
.button--primary
.button--small
The Delete button is styled as a link. Rather than define it as .button--delete
, it is probably better to create a .link
class and style is as .link--danger
. So, danger buttons would be marked up as <button class="link link--danger">Async delete</button>
or <a href="" class="link--danger" href="">Delete node</a>
Comment | File | Size | Author |
---|---|---|---|
#6 | buttons-p5.txt | 6.69 KB | ry5n |
#6 | buttons-p4-with-p5.interdiff.txt | 8.24 KB | ry5n |
#4 | buttons-4.patch | 4.73 KB | LewisNyman |
#1 | buttons-1.patch | 5.14 KB | LewisNyman |
Comments
Comment #1
LewisNymanAdded
button--primary
,button--small
, andbutton--danger
.Kept the class as
button--danger
for now just to keep them all in the same place and consistent. The actual CSS wouldn't change that much if we wanted to make thelink--danger
class work with<button>
s.It seems like we need a
button--primary-danger
class? It would be nice to cover situations where the primary action is also a dangerous action. Confirming a deletion is a core example.The iframes might be messing with hover effects. Also had to guess the font-size for the small buttons. Looks good though!
Comment #2
LewisNymanComment #3
oresh CreditAttribution: oresh commented- this style doesn't affect anything, can be deleted
- Danger buttons have .boxshadow .button:focus applied when focused, and have border radius, thought there should be none or different focus.
- If you press red danger button and start dragging it - you'll get grey background gradient under it.
- At line 70 there is a class dublication:
Looks good on small screens, i think the font size for small buttons is ok.
Tested on Chrome v.24 on Linux
Comment #4
LewisNymanFairly simple fixes, I've remove the
button
class from button--danger. That inheritance makes no sense.Comment #5
oresh CreditAttribution: oresh commentedAwesome!
Only one more point, i think the box shadow transition looks really good on grey button, but on the blue button you get a strange two-step effect on hover.
The other thing - the bottom border is really to dark on hover, and the shadow visually increases the height of the button for a pixel or two (depending on screen brightness). And the shadow also makes it's deal with this dark border (1 extra dark pixel)
So when i hover the button, it looks like it's growing for 2 pixels, which is kind of weird. Lets do something like this:
and remove transition for box-shadow.
Thank you!
Comment #6
ry5n CreditAttribution: ry5n commented@oresh You’re right that the shadow transition was a bit funky. I think I’ve cleaned it up a bit in the attached patch. I also notice that I didn’t get the contrast quite right in Photoshop for the primary buttons (for the hover and active states) so I tweaked those a bit. I also added a bit more side padding to all the large buttons. Small buttons have a bit bigger text to match the design.
I also moved the danger classes into a separate set of styles, .link (to style non-anchors as links, for e.g. buttons) and .link--danger for the danger variant. I want there to be a clear-cut rule for variants that the base class must always appear with the variant class, so there’s no question that if I apply `.button--small` I *must* apply `.button` as well. This makes sense, since a variant class assumes the base styles and modifies them in some way. Does that make sense?
Comment #7
ry5n CreditAttribution: ry5n commentedI’ve pushed the latest to the `buttons` branch. Live preview: http://drupalcode.org/sandbox/ry5n/1932040.git/blob_plain/refs/heads/but...
Comment #8
Bojhan CreditAttribution: Bojhan commentedThe first thing I notice, besides them being quite cool :) Is that the blue button could use a tiny gradient. It looks a little flat compared to the other buttons.
@r5yn How do you feel about this?
Comment #9
ry5n CreditAttribution: ry5n commented@Bojhan I agree they should match a bit better. The Primary buttons actually have a gradient, but it’s subtle, and less noticeable than the standard buttons. I think because the Primary version is such a dark colour. I’ll be able to tackle this and some more issues in a few days.
Comment #10
Bojhan CreditAttribution: Bojhan commentedIt's probably a little too subtle.
Comment #11
ry5n CreditAttribution: ry5n commentedI think the gradient subtleties are something for later. For now, this is in good enough shape for an initial merge with master. Using RTBC as a shorthand for ‘ready for first merge’.