iphone 6 and android device media query conflict - responsive-design

6I am trying to target android device and iphone 6 with media queries.
My android device is ZTE Blade Vec 4G. I think it has same resolution with galaxy s3. (1280x720)
However my android device use iPhone 6 media queries even I specified them separately
#media only screen and (min-device-width : 360px) and (min-device-width : 640px) and
(-webkit-device-pixel-ratio : 2) {
}
#media only screen and (min-device-width : 375px) and (max-device-width : 667px) and
(orientation : landscape) and (-webkit-min-device-pixel-ratio : 2) {
}

Related

How do I override the custom font in the Hugo book theme?

So I am building a site with the hugo-book theme. The docs here (under Extra Customization) say to create scss files under ./assets, while the theme submodule itself stores its css defaults under ./theme/hugo-book/assets.
Following this logic I created an scss file at ./assets/_fonts.scss:
/* merriweather-regular - latin */
#font-face {
font-family: 'Merriweather';
font-style: normal;
font-weight: 400;
src: local(''),
url('fonts/merriweather-v28-latin-regular.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/merriweather-v28-latin-regular.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* merriweather-italic - latin */
#font-face {
font-family: 'Merriweather';
font-style: italic;
font-weight: 400;
src: local(''),
url('fonts/merriweather-v28-latin-italic.woff2') format('woff2'), /* Chrome 26+, Opera 23+, Firefox 39+ */
url('fonts/merriweather-v28-latin-italic.woff') format('woff'); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
body {
font-family: 'Merriweather', sans-serif;
}
but hugo is still picking up the default roboto font from the theme directory. The fonts are stored under ./static/fonts and the hugo compiler seems to be picking up the changes.
Should I instead be making changes to the hugo-theme submodule and not worrying about it? That doesn't seem right. Searching the internet shows references to a custom_css params entry in config.toml but it would be pointing to ./assets - is this not the default?
Asking here before I ask the hugo-book author, in case I am missing something simple.
You have to create an assets folder from the root of your theme. This assets folder should not be inside any other folder.
For the fonts, create a folder by the name of static and inside of that create another one by the name of fonts and put your web fonts inside of it.
For the fonts to work, paste the font stylesheet into _custom.scss partial and change the URL path there. After that these should work without any issues.
Note: the static folder shouldn't be inside another folder.
assets
_custom.scss
static/fonts
webfonts.woff

react-slick carousel CSS, "Failed to compile" error

I'm having an issue with my react-slick carousel. I'm following official documentation and installation steps but I'm getting this error:
It seems to be a very common error, and I've tried solution which I've found here on stackoverflow - delete this block of code from slick-theme.scss.
/* Slider */
.slick-list {
.slick-loading & {
background: #fff slick-image-url("ajax-loader.gif") center center no-repeat;
}
}
/* Icons */
#if $slick-font-family == "slick" {
#font-face {
font-family: "slick";
src: slick-font-url("slick.eot");
src: slick-font-url("slick.eot?#iefix") format("embedded-opentype"), slick-font-url("slick.woff") format("woff"), slick-font-url("slick.ttf") format("truetype"), slick-font-url("slick.svg#slick") format("svg");
font-weight: normal;
font-style: normal;
}
}
Firstly, it doesn't help, but after 5 minutes of trying to find another solution it magically starts working and now, after 10 minutes of trying to configure it, stylize it and add content to slides, this error fires again.
Does anybody please have solution for this? Or maybe some advice for different React carousel which is not as buggy as this one? Even if it starts working for 10 minutes, some features didn't work, for example, dots, the were no arrows for switching slides, etc.
Thanks for any help.

Chrome Responsive show different as Firefox

sorry for my English...
I do try to write the Media Query for Samsung SM-J810F Galaxy J8 1480 x 720 .
I write on Media Query;
#media only screen and (device-width: 30.8125em)
and (device-height: 15em)
and (-webkit-min-device-pixel-ratio: 2)
and ( min--moz-device-pixel-ratio: 2)
and (orientation: landscape) {
Here how to show on Firefox
Here how to show on Chrome;
How to see, on Chrome to show the nav different..., also to come an Element which I will not display it, it displays on Chrome but not on Firefox...
Can please anyone explains my mistake, because display this element on Chrome.
very Thanks for your answer!
Your media query looks problematic to me because it includes webkit AND mozilla vendor prefixes, so I'm not sure if it will give the results you are expecting.
I have two suggestions you could try.
(1) Rewrite you media query as
#media
only screen and (device-width: 30.8125em)
and (device-height: 15em)
and (-webkit-min-device-pixel-ratio: 2)
and (orientation: landscape),
only screen and (device-width: 30.8125em)
and (device-height: 15em)
and ( min--moz-device-pixel-ratio: 2)
and (orientation: landscape) {
or
(2) Use the more future proof dppx syntax
source https://developer.mozilla.org/en-US/docs/Web/CSS/#media/-webkit-device-pixel-ratio
#media
only screen and (device-width: 30.8125em)
and (device-height: 15em)
and (min-resolution: 2dppx)
and (orientation: landscape) {
Good luck, I hope one of these suggestions works for you!

primefaces show contextmenu on mobile devices

I've searched a lot but I can't hit the answer, my problem is that I have a datatable with a context menu. On desktop I have no problem, it shows up on right click, but on mobile devices I can't get it to work: when I tap and hold the row it selects the nearest text and shows up the browser's context menu.
I've tried a lot of things:
Adding a css class style:
.noselect {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}
and the implementation as:
<p:dataTable id="lista" widgetVar="lista" var="unElem" ...>
<p:column headerText="Column 1" styleClass="noselect">
<h:outputText value="#{unElem.codigo}"/>
</p:column>
</p:dataTable>
<p:contextMenu for="lista" id="context" model="#{view.modeloMenuContextual}"/>
Searching on the web about the "event" attribute of the p:contextMenu and found that the default event is "contextmenu", so if you need other events you can add them space separated. The other event I found was "click", but I don't need it
<p:contextMenu model="#{view.modeloMenuContextual}" event="click contextmenu"/>
Searching in the official documentation (web and pdf) (https://www.primefaces.org/showcase/)
Searching in Primefaces' code in github (https://github.com/primefaces/primefaces)
I'm working with PrimeFaces 6.2
Hope anybody can help me.
Thanks!

Media Query parse error in iphone 5

I am making a responsive site www.sandbox.mercomcorp.com and I am getting a parse error on wordpress in my css on my media query for iphone 5. I have no idea why
#media only screen and (device-height:568px) and (device-width:320px) and (-webkit-min-device pixel-ratio:2) and (orientation :landscape)
I guess it should be -webkit-min-device-pixel-ratio:2. You've got a space between device and pixel.

Resources