When the dropbuttons were styled for Views, the CSS was placed in Views and not CTools.
This greatly reduces their usefulness, since they are unstyled by default unless the Views admin CSS is specifically added. Since they are a new UI pattern, we definitely want them to look the same everywhere.

So let's move the Views CSS into CTools.

Comments

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new11.89 KB

Here's a patch. I've opened a matching Views issue: #1557722: Remove dropbutton css after it gets committed to CTools.

Notes:
1) Modified ctools_add_css() to support theme specific CSS. Do we want to allow overriding styles for core themes via the theme directory, like Views does? See views_ui_get_admin_css() for context.
2) Why do we have the button.css / dropbutton.css separation in the first place?
3) Didn't add the *.theme.css files (Views separates structure into the main file and borders and elementary colors into *.theme.css). Not sure if we need / want it in this context.
4) Right now due to the way dropbuttons are styled (position: absolute in two places), they escape the views tablerow unless it has vertical-align: top specified.
Not sure if I can fix this generically this without modifying the CSS (and I didn't want to do that in first pass).

Comments?

merlinofchaos’s picture

I believe the styling was left in Views because, at the time, we considered the styling Views-specific. This may not actually be true, however. I will see if I can get jbeach to comment on this.

pancho’s picture

This would be really awesome.

It would lead to a quite some more projects starting to implement dropbuttons.
Even more we should consider backporting Dropbutton from D8, in the sense of taking over as much as possible without breaking the basic dropbutton API in CTools 7.x-1.x.

See the D8 core issue plus followups:

But starting with the CSS might be fine.

Status: Needs review » Needs work

The last submitted patch, 1557662-dropbutton-css.patch, failed testing.

pancho’s picture

Status: Needs work » Needs review
StatusFileSize
new3.4 KB

EDIT: Sorry, something got wrong with this one.

pancho’s picture

StatusFileSize
new11.64 KB

Now, let's start with a plain reroll of #1.

pancho’s picture

Fine.
And now there's one rule that in the meantime has been removed from Views UI and should be removed here, too:

.ctools-button-processed,
.ctools-button-processed input {
  text-transform: lowercase;
}

Enclosed patch is a 1:1 replacement for the Dropbutton CSS in current Views UI.
Hopefully RTBC.

mgifford’s picture

joachim’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new47.67 KB

Patch works great. Please commit!

(I'd be inclined to say this is a bug, because without it, the dropbuttons look awful:

japerry’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new618.05 KB

Review looks okay, but when I test it on the ember theme, it looks somewhat broken :-(

japerry’s picture

Status: Needs work » Closed (outdated)

Drupal 7 is no longer supported, closing.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.