Bootstrap 3 - printing colors on progress bars? - css

Anybody figured out how to print the colors on progress bars in bootstrap 3? Saw some hacks for 2.3.2 but I can't do it on bootstrap 3.
.progress {
background-image: none;
-webkit-print-color-adjust: exact;
box-shadow: inset 0 0;
-webkit-box-shadow: inset 0 0;
}
.progress > .progress-bar {
background-image: none;
-webkit-print-color-adjust: exact;
box-shadow: inset 0 0;
-webkit-box-shadow: inset 0 0;
}
Maybe a starting point for someone, based off of some code I found for the old workaround.

To build on the prior answer this is how I have the CSS setup to print from Chrome or IE. FireFox still does not work. You'll need to set up each bar color though.. info, success, etc.
#media print{
.progress{
background-color: #F5F5F5 !important;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#F5F5F5', endColorstr='#F5F5F5')" !important;
}
.progress-bar-info{
display: block !important;
background-color: #5BC0DE !important;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#5BC0DE', endColorstr='#5BC0DE')" !important;
}
.progress, .progress > .progress-bar {
display: block !important;
-webkit-print-color-adjust: exact !important;
box-shadow: inset 0 0 !important;
-webkit-box-shadow: inset 0 0 !important;
}
}
Reference:
CSS #media print issues with background-color;

Beside the -webkit-print-color-adjust: exact; for b.e. .progress-bar-success you will have to make the background visible also. You can do this by adding !important to the ccs rules, see: Background color not showing in print preview
Add / bind the different print style to #media print in a different style sheet.
For printing the borders / shadows of the progress bar add !important to the border-box properties too. See also: Remove shadow from printed version and text-shadow and box-shadow while printing (Chrome)

This is because the browser doesn't print backgrounds (with default settings), but it prints borders and we can use it!
Just try this https://stackoverflow.com/a/46216102/8601222
Edited after comments
You can add this for #media print (my LESS-CSS code):
#media print {
.progress {
position: relative;
&:before {
display: block;
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 0;
border-bottom: #line-height-computed solid #gray-lighter;
}
&-bar {
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 1;
border-bottom: #line-height-computed solid #brand-primary;
&-success {
border-bottom-color: #brand-success;
}
&-info {
border-bottom-color: #brand-info;
}
&-warning {
border-bottom-color: #brand-warning;
}
&-danger {
border-bottom-color: #brand-danger;
}
}
}
}
Compiled CSS (with my variables):
#media print {
.progress {
position: relative;
}
.progress:before {
display: block;
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 0;
border-bottom: 2rem solid #eeeeee;
}
.progress-bar {
position: absolute;
top: 0;
bottom: 0;
left: 0;
z-index: 1;
border-bottom: 2rem solid #337ab7;
}
.progress-bar-success {
border-bottom-color: #67c600;
}
.progress-bar-info {
border-bottom-color: #5bc0de;
}
.progress-bar-warning {
border-bottom-color: #f0a839;
}
.progress-bar-danger {
border-bottom-color: #ee2f31;
}
}
Works like a charm in Bootstrap 3.

Related

How to surround an overlayed (z-indexed) image with a surrounding ring of transparency? [duplicate]

This question already has an answer here:
How to cut a circular part from an image?
(1 answer)
Closed 1 year ago.
I am trying to create image icons that have a status dot which emulates Slack member-icons (left).
How can I use CSS to add a transparent ring around the dot?
.memberIconRow {
display: flex;
.memberIconArea {
position: relative;
img {
width: 30px;
margin: 0 6px 0 0;
border-radius: 5px;
}
.statusDot {
background: #f00;
width: 10px;
height: 10px;
border-radius: 50%;
position: absolute;
z-index: 2;
top: 21px;
left: 23px;
}
}
}
Some dirty trick what I think of is add border to your dot with the same background as your photo, in this case - a light yellow.
Like this -
.statusDot {
...
border:4px solid yellow; /* same color as you profile photo background */
}
In multiple background colours case, use css var() like;
:root {
--blue: #1e90ff;
}
.member-bg {
background-color: var(--blue);
}
. statusDot {
border: 4px solid var(--blue);
}

How to remove QScrollbar scroll buttons?

I want to style QScrollBar to look like this without the indicators in the end
I tried with the stylesheets:
QScrollBar::up-arrow:vertical, QScrollBar::down-vertical
{
border: none;
background: none;
color: none;
}
But this hides the indicator arrow not the 2 buttons at the end
You can use something like this:
QScrollBar:vertical {
background: #2f2f2f;
width: 15px;
margin: 0;
}
QScrollBar::handle:vertical {
background: #5b5b5b;
}
QScrollBar::add-line:vertical {
height: 0px;
}
QScrollBar::sub-line:vertical {
height: 0px;
}
QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {
height: 0px;
}
The classes you were looking for are add-line, sub-line, add-page and sub-page. Since they support the box-model, you can just set their height to 0 to make them disappear.
The code above was tested with Qt 5.9.

Full calendar - Style cell date of day

I have done a calendar with plugin full-calendar. I want to change the style of today date.
.fc-unthemed .fc-today {
color: #fff !important;
background-color: red;
}
But the background color of the cell, have to be like the next image.
How could do it? Thanks
You can apply CSS to create border like a triangle and show it at the top-right corner.
.fc-day.fc-today {
position: relative;
}
.fc-day.fc-today::before,
.fc-day.fc-today::after {
content: '';
position: absolute;
top: 0;
right: 0;
border-color: transparent;
border-style: solid;
}
.fc-day.fc-today::before {
border-width: 1.5em;
}
.fc-day.fc-today::after {
border-radius: 0;
border-width: 1.5em;
border-right-color: red;
border-top-color: red;
}
The output will be shown like below.

Kendo legacy theme's problems

This is a self-answered question
I'd like to use Kendo legacy themes for my app, since default themes are extremely ugly. I chose Office 2007 theme. I've included the following files:
<link href="~/Content/kendo/legacy/telerik.common.css" rel="stylesheet" />
<link href="~/Content/kendo/legacy/telerik.office2007.min.css" rel="stylesheet" />
I came across several problems with this themes that I'm not able to get ride of them and any help is appreciated.
Aligning buttons. Custom buttons are higher in the grid than the Grid's buttons.
Paging. Current page's number is shown in the corner. Also pagination's buttons are reverse, and page number's box is too big.
Multi select's wheel doesn't stop, even after loading items!
And finally, window's minimize button isn't visible.
This is the CSS I have used for buttons:
.k-grid .k-button{
width: 10px;
min-width: 10px !important;
}
.k-grid-custom,
.k-grid-custom:hover{
background-image: url('/Content/Images/Icon/icon.png');
height: 20px;
background-position: center;
background-repeat: no-repeat;
}
.k-edit{
background-image: url('/Content/Images/Icon/Edit.png');
background-position: 0 0 ;
}
Well, I worked around the multiselect's problem with robbing some of CSS from kendo.common.css.
.k-multiselect-wrap {
position: relative;
border-width: 0;
border-style: solid;
border-radius: 4px;
border-color: #c5c5c5;
background-color: #FFF;
min-height: 2.04em;
}
.k-multiselect-wrap .k-input {
background-color: transparent;
height: 1.31em;
line-height: 1.31em;
padding: .18em 0;
text-indent: .33em;
border: 0;
margin: 1px 0 0;
float: left;
}
.k-multiselect-wrap li {
margin: 1px 0 1px 1px;
padding: .1em 1.6em .1em .4em;
line-height: 1.5em;
float: left;
position: relative;
}
.k-autocomplete .k-loading, .k-multiselect .k-loading {
position: absolute;
right: 3px;
bottom: 4px;
}
.k-multiselect .k-loading-hidden {
visibility: hidden;
}
.k-multiselect-wrap .k-select {
position: absolute;
top: 0;
bottom: 0;
right: 0;
padding: .1em .2em;
}
You can hide current page's number:
.k-pager-numbers .k-current-page {
display: none;
}
Page numbers' size:
.k-pager-wrap .k-dropdown {
width: 4.500em;
}
For pagination's arrows, if you're using left-to-right you won't have any problem. In case you're using right-to-left, k-rtl, replace following CSS in telerik.common.css, line #230:
.k-i-seek-w { background-position: -48px -192px; }
.k-i-arrow-w { background-position: -32px -192px; }
.k-i-arrow-e { background-position: -16px -192px; }
.k-i-seek-e { background-position: 0 -192px; }
.k-state-disabled .k-i-seek-w { background-position: -48px -208px; }
.k-state-disabled .k-i-arrow-w { background-position: -32px -208px; }
.k-state-disabled .k-i-arrow-e { background-position: -16px -208px; }
.k-state-disabled .k-i-seek-e { background-position: 0 -208px; }
.k-state-hover .k-i-seek-w { background-position: -48px -224px; }
.k-state-hover .k-i-arrow-w { background-position: -32px -224px; }
.k-state-hover .k-i-arrow-e { background-position: -16px -224px; }
.k-state-hover .k-i-seek-e { background-position: 0 -224px; }
For the minimize button in Kendo Window, it seems they forgot to add the CSS!
.k-i-minimize {background-position: -32px -368px; }
Use the following CSS to align custom buttons with grid's buttons.
.k-grid .k-button {
vertical-align: bottom;
}

change scroll-bar format in Mozilla and I.E like chrome

I want to change scroll-bar color and other properties;
So I wrote the code bellow for chrome:
/* Chrome */
.contex#context::-webkit-scrollbar { width: 10px; height: 0px;}
.contex#context::-webkit-scrollbar-button { background-color: #800000; }
.contex#context::-webkit-scrollbar-track { background-color: #40210f;}
.contex#context::-webkit-scrollbar-track-piece { background-color: #ffffff;}
.contex#context::-webkit-scrollbar-thumb { height: 50px; background-color: #40210f; border-radius: 50%;}
.contex#context::-webkit-resizer { background-color: #666;}
/* Chrome */
This is jsfiddle and This is full screen if you use chrome you can see right result.
and I tried this code for I.E. :
.contex#context {
background-color:#fff;
overflow:scroll;
width:565px;
height:490px;
padding-right:5px;
margin-left:140px;
margin-top:100px;
text-align:right;
font-family:"B Koodak",Arial, Sens Serif;
position:absolute;
/* I.E scroll-bar */
scrollbar-face-color: #40210f;
scrollbar-track: transparant;
scrollbar-base-color: #40210f;
scrollbar-face-color: #40210f;
scrollbar-3dlight-color: #800000;
scrollbar-highlight-color: #FFF;
scrollbar-track-color: #FFFFFF;
scrollbar-arrow-color: #40210f;
scrollbar-shadow-color: white;
scrollbar-dark-shadow-color: #800000;
}
But it's not enough for my case.
Now I want to change scroll-bar in I.E and Mozila like I did for chrome.
Specially I want to change scrollbar-thumb with border-radius
Do you have suggestion for me to make something like this in FireFox and I.E.?Thanks in advance.
What you can use is this Jquery Plugin.
http://jscrollpane.kelvinluck.com/fullpage_scroll.html
You will need all of these plugins:
jquery
mousewheel
mwheelIntent
scrollpane
Once you acquire all of these and implement them, then you can edit the CSS for the scrollbars to what you want. Make sure you use the code provided on that page.
For instance, on the page I provided, these CSS styles can be altered to get what you want.
.jspArrow {
background: #800000; // Changed color
text-indent: -20000px;
display: block;
cursor: pointer;
padding: 0;
margin: 0;
}
.jspArrow.jspDisabled {
cursor: default;
background: #800000; // Color change, but line not necessary
}
.jspDrag {
background: #40210f; // Changed color
position: relative;
top: 0;
left: 0;
cursor: pointer;
border-radius: 50%; // Added line
}
.jspTrack {
background: #dde; // Remove this line
position: relative;
}
.jspVerticalBar {
position: absolute;
top: 0;
right: 0;
width: 16px;
height: 100%;
background: red; // Remove this line
}
Realize that border-radius does not work on older versions of Internet Explorer.
Check out your options here: http://www.unheap.com/?s=scroll
The most popular solution seems to be http://www.yuiazu.net/perfect-scrollbar/

Resources