I use Mate desktop 1.26 (GTK 3.24) and I want to update my CSS theme for OSD.
Is there a way with a very simple program to keep OSD displayed to debug it with GTK-inspector? Or is someone know the CSS nodes?
The first screenshot was taken with default theme, the second with my theme. I try to remove the black border, to set the background color I use the following piece of code, but it's ridiculous:
.osd * {
background: #theme_bg;
}
EDIT: I found an horrible way, it seems that we can't change the black border width (12px):
.osd {
border: 12px solid #nb_border;
border-radius: 0;
background: #theme_bg;
}
.osd > box {
background: #theme_bg;
box-shadow:
0 -11px #theme_bg, /* top */
11px 0 #theme_bg, /* right */
0 11px #theme_bg, /* bottom */
-11px 0 #theme_bg, /* left */
-11px -11px #theme_bg, /* top left */
11px -11px #theme_bg, /* top right */
11px 11px #theme_bg, /* bottom right */
-11px 11px #theme_bg /* bottom left */;
}
Related
I'm using Material-UI and Styled-Components. And I'm struggling with changing the color of the slider. I've been able to change the color of the thumb and track. But when hovering over and clicking the thumb, a blue haze surrounds the thumb. How do I change the color of this?
I've been able to style other parts (track, ticks, thumb etc) using the classes mentioned in the API (https://material-ui.com/api/slider/#css). But not this shadow effect.
https://codesandbox.io/s/ecstatic-satoshi-3mzrj?file=/src/App.js
The shadow effect is also a part of thumb.
You can simply use something like
& .MuiSlider-thumb:hover {
color: red;
box-shadow: 0 0 0 10px rgba(0, 255, 0, 0.3) !important;
}
or if you don't want to use !important, try to manipulate it with this class:
.MuiSlider-thumb.Mui-focusVisible, .MuiSlider-thumb:hover {
// your code here
}
How do I get ng-enter and ng-leave animations to work in ion-view?
<ion-view class="kitchenmenu"></ion-view>
CSS:
.kitchenmenu{background:yellow}
.kitchenmenu.ng-leave {
-webkit-animation: animated slideInDown 0.5s both ease-in;
-moz-animation:animated slideInDown 0.5s both ease-in;
animation: animated slideInDown 0.5s both ease-in;
}
.kitchenmenu.ng-enter {
-webkit-animation:animated slideInUp 0.5s both ease-in;
-moz-animation:animated slideInUp 0.5s both ease-in;
animation:animated slideInUp 0.5s both ease-in;
}
The above however does not work. I tried adding ng-view directive to it as well but no help.
In an HTML project, I'm using css to adjust the content layout for specific screen sizes, e.g.
the iPad landscape;
/*
##########################################################################
##########################################################################
iPad Layout Landscape: 1024px.
Content-Element width: 896px.
Gutters: 24px.
Outer content margins: 64px.
Inherits styles from: Default Layout.
##########################################################################
cols 1 2 3 4 5 6 7 8 9 10
px 68 160 252 344 436 528 620 712 804 896
##########################################################################
##########################################################################
*/
#media only screen and (max-device-width: 1024px) and (orientation:landscape) {
}
and that one works but for iPhone 5 portrait, I'm using;
/*
iPhone 5 portrait view
*/
#media screen and (max-device-width: 640px) and (max-device-height: 1136px) and (orientation:portrait) {
}
which doesn't work, that is it's shown as the iPhone 4 version (
/*
#########################################################################
##########################################################################
Overrides styles for devices with a
device-pixel-ratio of 2+, such as iPhone 4.
#########################################################################
##########################################################################
*/
#media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and (min-device-pixel-ratio: 2) {
}
).
The point is, these work for the devices described but on the iPhone 5, it is shown with the iPhone 4 settings, it needs to be made for the Retina 4-inch properties
Any ideas why and how to make it work?
Try this media query?
iPhone 5 media query
#media screen and (device-aspect-ratio: 40/71) {
/* styles for iPhone 5 goes here */
}
*SO Link iPhone 5 CSS media query
If you want to target more than just iOS devices, it's best to avoid the device media queries. On iOS those queries always reflect the portrait width and height, regardless of orientation. On Android and other operating systems, the device width and height will change based on orientation.
So if you want to use a media query that consistently matches the width and height of the current orientation across all devices, you should use max-width/max-height rather than max-device-width/max-device-height. This max sense for desktop browsers too, since you're more interested in the size of the browser window than you are the size of the user's monitor.
Another thing you should always do when working with media queries on mobile devices is to set the viewport metatag with width=device-width. If you don't do this, the media queries will often reflect a virtual viewport which isn't at all what you would expect.
For more information, I'd recommend reading this article from quirksmode.org.
Try to use this:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){
CGSize result = [[UIScreen mainScreen] bounds].size;
CGFloat scale = [UIScreen mainScreen].scale;
result = CGSizeMake(result.width *scale, result.height *scale);
//here you can use height or width if depend for landscape or portrait
if(result.height == 960){
//here wat you need to load
}
}
Hope this help you or illuminate to other ways ;)
Why not break this down into a few different queries?
#media only screen and (max-width : 1024px) {
}
#media only screen and (max-width : 640px) {
}
#media only screen and (max-height : 1136px) {
}
#media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
}
#media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi){
/* 1.25 dpr */
}
#media (-webkit-min-device-pixel-ratio: 1.3), (min-resolution: 124.8dpi){
/* 1.3 dpr */
}
#media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi){
/* 1.5 dpr */
}
After I use CSS transition or animation that includes rotate the whole containing div gets a little bit blurry,
I read that it is some kind of side effect from redrawing the element, but is there a way to prevent it?
.toggle {
position: absolute;
width: 36px;
height: 36px;
bottom: 7px;
right: 94px;
z-index: 200;
background: transparent url("../img/handle-open.png") no-repeat;
-webkit-transition: all 1s cubic-bezier(0.91,0.00,1.00,1.00);
-moz-transition: all 1s cubic-bezier(0.91,0.00,1.00,1.00);
transition: all 1s cubic-bezier(0.91,0.00,1.00,1.00);
}
.toggle-closed {
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
transform: rotate(180deg);
}
I tries to achieve the same with animate and got the same result
Update: I noticed something weird happening - in chrome, when the animation runs the element gets blurry and when the animation stops it return to normal,
on iOS however it happens the other way around - the image is clear while animated but gets blurry when completed! another weird #$$ bug!?
Ive seen issues such as this before after doing animations. Check the dimensions of the object after the transition, it may very well have changed in size by a few points causing blurry-ness. i,e:
Before transition: 36x36
After Transition: 36.2 x 36.8
I'm trying to animate a canvas on three different layers on the onmousedown and ontouchstart. The three canvas go from left to right at a different speed to give a perspective effect as long as the onmouseup or ontouchend are not fired.
I am using #-webkit-keyframes css to do my animations:
#-webkit-keyframes aCarsRight
{
from{background-position: 0px 0px;}
to{background-position: 640px 0px;}
}
.cars_move_right
{
-webkit-animation-name: aCarsRight;
-webkit-animation-duration: 5s;
-webkit-animation-iteration-count: 1;
-webkit-transition-timing-function: linear;
}
What I would like to do is get the current background-position of the three layers prior to disabling the pan animation and set them manually so when I remove the .cars_move_right class from my div is stays in the same position instead of rolling back to its default position.
Is there a way to get the background-position or just a work around to get what I want? The page is meant for iPhone and iPod Touch.
Thanks !
I found something interesting. Instead of grabbing the background-position, stop the animation and set the background-position to my divs, I pause the animation.
document.getElementById('global').style.webkitAnimationPlayState = 'paused';
document.getElementById('global_cars').style.webkitAnimationPlayState = 'paused';
document.getElementById('global_car').style.webkitAnimationPlayState = 'paused';
Haven't had the chance to test it on iPhone yet.
And, here's a method that seems to work cross-browswers to get any property:
window.getComputedStyle(document.getElementById('div'))['background-position'];
Have you tried:
var blah = ele.style.backgroundPosition;
That will return it like "10px 57px"
If the css rule has a hyphen in it then afaik in Javascript the hyphen is removed and camel case applied.
I found that I can use this to get the property I couldn't get with [mydiv].style.[property]
function getProperty(property, div)
{
return window.getComputedStyle(document.getElementById(div))[property];
}