From 474700be84aa7c53a545d4201fcf0a3e0f5e4a12 Mon Sep 17 00:00:00 2001 From: George R Date: Thu, 12 Dec 2019 15:19:23 +0100 Subject: [PATCH] [OGUI-465] Common css blocks (#434) * [OGUI-465] Add dropup element * [OGUI-465] Add smaller sidebar class * [OGUI-465] Tooltip underneath * [OGUI-465] Docs and Exs for new CSS blocks * Bump WebUI --- Framework/Frontend/css/src/bootstrap.css | 15 +++++++++++- Framework/docs/reference/frontend-css.html | 28 ++++++++++++++++++++++ Framework/package-lock.json | 2 +- Framework/package.json | 2 +- 4 files changed, 44 insertions(+), 3 deletions(-) diff --git a/Framework/Frontend/css/src/bootstrap.css b/Framework/Frontend/css/src/bootstrap.css index f5b162dc0..f5b3d0e73 100644 --- a/Framework/Frontend/css/src/bootstrap.css +++ b/Framework/Frontend/css/src/bootstrap.css @@ -270,6 +270,19 @@ svg.icon { height: 1em; width: 1em; margin-bottom: -0.2em; } .dropdown-open > .dropdown-menu { display: block; } .dropdown-menu { z-index: 300; box-shadow: 0 8px 17px 2px rgba(0,0,0,0.14), 0 3px 14px 2px rgba(0,0,0,0.12), 0 5px 5px -3px rgba(0,0,0,0.2); display: none; position: absolute; top: calc(100% + 0.1rem); left: 0.1rem; z-index: 1000; font-size: 1rem; background-color: #fff; border: 1px solid rgba(0,0,0,.15); border-radius: .25rem; } + +/* dropup */ + +.dropup { position: relative; display: inline-block; } +.dropup-open>.dropup-menu { display: block; } +.dropup-menu { box-shadow: 0 8px 17px 2px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2); display: none; position: absolute; bottom: calc(100% + 0.1rem); left: 0.1rem; z-index: 1000; font-size: 1rem; background-color: #fff; border: 1px solid rgba(0, 0, 0, .15); border-radius: .25rem; } + +/* tooltip */ +.tooltip {position: relative; display: inline-block; border-bottom: 1px dotted black;} +.tooltip .tooltiptext {visibility: hidden; width: 118px; background-color: #555; color: #fff; text-align: center; padding: 3px; border-radius: 6px; position: absolute; z-index: 1;} +.tooltiptext::after {content: ""; position: absolute; bottom: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: transparent transparent #555 transparent;} +.tooltip:hover .tooltiptext {visibility: visible;} + /* form */ .form-group { margin-bottom: 1em; } @@ -289,7 +302,7 @@ label { display: block; margin-bottom: 0.5em; } .sidebar .sidebar-content { width: 15em; height: 100%; overflow: hidden; } .sidebar-extend { width: 30em; } .sidebar-extend .sidebar-content { width: 30em; } - +.sidebar-minimal { width: 3.6em; } /* Component Notification */ /* moves to screen to get user attention */ /* 'display none' in .notification-close allow after animation to click though notification on other content */ diff --git a/Framework/docs/reference/frontend-css.html b/Framework/docs/reference/frontend-css.html index 39a79c4e0..220a98f12 100644 --- a/Framework/docs/reference/frontend-css.html +++ b/Framework/docs/reference/frontend-css.html @@ -213,6 +213,33 @@

Buttons

+

Dropup:
+

+ + +
+

+ +

Tooltip:
+

+ + Hooray! +
+

+ + link to external website

@@ -685,6 +712,7 @@

App layout

split in half to preview some element at the bottom and have a menu at the top.

Sidebar can also grow is more place is needed, use .sidebar-extend or just specify the width you want with a style attribute.

+

Sidebar can also be used in a minimal iconic way if needed, use .sidebar-minimal

Only flex (.flex-row or .flex-column with .flex-grow) and position (.relative and .absolute-fill) are required for most of your needs.

.scroll-y should be applied to layouts before content.

diff --git a/Framework/package-lock.json b/Framework/package-lock.json index 57ff28698..a43af8edc 100644 --- a/Framework/package-lock.json +++ b/Framework/package-lock.json @@ -1,6 +1,6 @@ { "name": "@aliceo2/web-ui", - "version": "1.9.0", + "version": "1.9.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/Framework/package.json b/Framework/package.json index 0ccfdb48c..2e84de365 100644 --- a/Framework/package.json +++ b/Framework/package.json @@ -1,6 +1,6 @@ { "name": "@aliceo2/web-ui", - "version": "1.9.0", + "version": "1.9.1", "description": "ALICE O2 Web UX framework", "author": "Adam Wegrzynek", "license": "GPL-3.0",