From 0bfca75f4506e5e9a8a4dcf5090465f013ca13e1 Mon Sep 17 00:00:00 2001 From: Diana Whitten Date: Sun, 24 Jan 2016 16:57:02 -0700 Subject: [PATCH] Context Picker should inherit BS dropdown styles The first step in the dynamic theme effort requires that the context selection picker inherit properly from a dropdown menu, so that the styles can be shared and the experience is matched. Dynamic themes will use the 'select' experience of the context menu but from within the user menu, so it was necessary to match the experiences to minimize duplicated code. The style of the context menu was extremely dependant on DOM structure and therefore difficult to customize. This has been simplified by using classes and attempting to keep specificity as low as possible. Change-Id: Idb9e8f5c1d246688418f68e12fb53f094c01ea34 Partially-implements: blueprint horizon-dynamic-theme Partially-Implements: blueprint bootstrap-html-standards --- .../scss/components/_context_selection.scss | 51 ------------------ .../dashboard/scss/components/_navbar.scss | 6 +++ .../scss/components/_selection_menu.scss | 52 +++++++++++++++++++ .../static/dashboard/scss/horizon.scss | 2 +- .../context_selection/_domain_list.html | 10 ++-- .../context_selection/_project_list.html | 14 ++--- .../context_selection/_region_list.html | 4 +- .../templates/header/_context_selection.html | 2 +- .../themes/default/horizon/_styles.scss | 1 + .../components/_context_selection.scss | 44 +++++++--------- .../default/horizon/components/_navbar.scss | 3 ++ .../material/static/horizon/_icons.scss | 2 +- .../material/static/horizon/_styles.scss | 2 + .../material/static/horizon/_variables.scss | 2 + .../static/horizon/components/_navbar.scss | 5 ++ .../horizon/components/_selection_menu.scss | 16 ++++++ 16 files changed, 124 insertions(+), 92 deletions(-) delete mode 100644 openstack_dashboard/static/dashboard/scss/components/_context_selection.scss create mode 100644 openstack_dashboard/static/dashboard/scss/components/_selection_menu.scss create mode 100644 openstack_dashboard/themes/default/horizon/components/_navbar.scss create mode 100644 openstack_dashboard/themes/material/static/horizon/components/_navbar.scss create mode 100644 openstack_dashboard/themes/material/static/horizon/components/_selection_menu.scss diff --git a/openstack_dashboard/static/dashboard/scss/components/_context_selection.scss b/openstack_dashboard/static/dashboard/scss/components/_context_selection.scss deleted file mode 100644 index 1f52e7c0c..000000000 --- a/openstack_dashboard/static/dashboard/scss/components/_context_selection.scss +++ /dev/null @@ -1,51 +0,0 @@ -.context-selection { - & > li > ul { - padding: 0; - - & > li { - white-space: nowrap; - - &.dropdown-header, - & > a { - padding: $dropdown-item-padding-vertical $dropdown-item-padding-horizontal $dropdown-item-padding-vertical $dropdown-item-padding-horizontal*1.5; - } - - &.dropdown-header { - color: $brand-primary; - } - - &:not(.dropdown-header):hover { - background-color: $dropdown-link-hover-bg; - cursor: pointer; - } - - & > a { - position: relative; - color: $dropdown-link-color; - text-decoration: none; - display: inline-block; - width: 100%; - - & > .fa.fa-check { - float: left; - position: absolute; - left: $dropdown-item-padding-horizontal/2; - line-height: $line-height-computed; - } - } - } - } - - .disabled { - cursor: not-allowed; - color: $dropdown-link-disabled-color; - } -} - -.context-delimiter { - font-size: $padding-small-vertical; - vertical-align: middle; - padding-right: $padding-small-vertical; - padding-left: $padding-small-vertical; -} - diff --git a/openstack_dashboard/static/dashboard/scss/components/_navbar.scss b/openstack_dashboard/static/dashboard/scss/components/_navbar.scss index ee36b789b..c9c2e7ead 100644 --- a/openstack_dashboard/static/dashboard/scss/components/_navbar.scss +++ b/openstack_dashboard/static/dashboard/scss/components/_navbar.scss @@ -32,3 +32,9 @@ } } +.context-delimiter { + font-size: $padding-small-vertical; + vertical-align: middle; + padding-right: $padding-small-vertical; + padding-left: $padding-small-vertical; +} diff --git a/openstack_dashboard/static/dashboard/scss/components/_selection_menu.scss b/openstack_dashboard/static/dashboard/scss/components/_selection_menu.scss new file mode 100644 index 000000000..43ef7ccbb --- /dev/null +++ b/openstack_dashboard/static/dashboard/scss/components/_selection_menu.scss @@ -0,0 +1,52 @@ +// FYI Note (hurgleburgler) +// The Selection Menu is not a normal drop down element +// This menu can contain other dropdown menus, and will +// treat them as a selection group element. +// The context menu shows this functionality. +// This drop down is composed of other