JQuery mobile theme roller 1.4.3 - jquery-mobile

Ok. So all the version of the Theme roller before 1.4.3 have options to choose a start and end color which creates a gradient on whatever you want.
Does anyone know how to get gradients in to a version 1.4.3 Theme?
version 1.4.3 (Below)
version 1.3.2 (Below)
Is there even any reason to use 1.4.3?

Have a look here: http://jquerymobile.com/upgrade-guide/1.4/ at the section titled Custom Theme.
Because gradients are no longer part of the default theme, they can't
be set with the ThemeRoller anymore either. You can still use
gradients, but you have to manually copy the background-image settings
from your current theme into your 1.4 theme CSS file.
.ui-body-a,
.ui-page-theme-a .ui-body-inherit,
html .ui-bar-a .ui-body-inherit,
html .ui-body-a .ui-body-inherit,
html body .ui-group-theme-a .ui-body-inherit,
html .ui-panel-page-container-a {
background: #333 /*{a-body-background-color}*/;
border-color: #111 /*{a-body-border}*/;
color: #fff /*{a-body-color}*/;
text-shadow: 0 /*{a-body-shadow-x}*/ 1px /*{a-body-shadow-y}*/ 0 /*{a-body-shadow-radius}*/ #111 /*{a-body-shadow-color}*/;
/* Copied from 1.3 custom theme: */
background-image: -webkit-gradient(linear, left top, left bottom, from( #444 ), to( #222 )); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #444, #222 ); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #444, #222 ); /* FF3.6 */
background-image: -ms-linear-gradient( #444, #222 ); /* IE10 */
background-image: -o-linear-gradient( #444, #222 ); /* Opera 11.10+ */
background-image: linear-gradient( #444, #222 );
}

Related

I have a dropdown menu and want to show a partial depending on the answer in Rails

I have a menu and I want to link to an apartment booking menu depending on the option chosen. There are three cities and when one city is selected I want to render the partial that contains the booking form.
The dropdown works, but I can't get it to show the correct partial based on selection. The partial contains different booking forms that are widgets coming from an external website. Once the partial is linked properly I can use ajax to make sure the page doesn't refresh when the partial is being loaded.
I'm very new to Rails and can't get this done. Am I on the right track here? Any help would be greatly appreciated!
<select name="locations">
<option value="basingstoke">Basingstoke</option>
<option value="cardiff">Cardiff</option>
<option value="sheffield">Sheffield</option>
<% if option_value_selected?(basingstoke, selected) %>
<%= render 'components/book_basingstoke' %>
<% elsif option_value_selected?(cardiff, selected) %>
<%= render 'components/book_cardiff' %>
<% else option_value_selected?(sheffield, selected) %>
<%= render 'components/book_sheffield' %>
<% end %>
</select>
Ruby on Rails is not a reactive view library like react.js. option_value_selected is evaluated at rendering time from server side. (Is not something you are looking for)
I would recommend you look this link jquery example.
Basically you need to render all three views at server side and hide them using js.
$(function() {
$('#colorselector').change(function() {
$('.colors').hide();
$('#' + $(this).val()).show();
});
});
// [forked from](http://jsfiddle.net/FvMYz/)
// [show-hide-based-on-select-option-jquery)(http://stackoverflow.com/questions/2975521/show-hide-div-based-on-select-option-jquery/2975565#2975565)
/* https://gist.github.com/toddparker/32fc9647ecc56ef2b38a */
/* Some basic page styles */
body {
font: 100%/1.5 AvenirNext-Regular, Corbel, "Lucida Grande", "Trebuchet Ms", sans-serif;
color: #111;
background-color: #fff;
margin: 2em 10%
}
/* Label styles: style as needed */
label {
display: block;
margin: 2em 1em .25em .75em;
font-size: 1.25em;
color: #333;
}
/* Container used for styling the custom select, the buttom class adds the bg gradient, corners, etc. */
.dropdown {
position: relative;
display: block;
margin-top: 0.5em;
padding: 0;
}
/* This is the native select, we're making everything the text invisible so we can see the button styles in the wrapper */
.dropdown select {
width: 100%;
margin: 0;
background: none;
border: 1px solid transparent;
outline: none;
/* Prefixed box-sizing rules necessary for older browsers */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
/* Remove select styling */
appearance: none;
-webkit-appearance: none;
/* Magic font size number to prevent iOS text zoom */
font-size: 1.25em;
/* General select styles: change as needed */
/* font-weight: bold; */
color: #444;
padding: .6em 1.9em .5em .8em;
line-height: 1.3;
}
.dropdown select,
label {
font-family: AvenirNextCondensed-DemiBold, Corbel, "Lucida Grande", "Trebuchet Ms", sans-serif;
}
/* Custom arrow sits on top of the select - could be an image, SVG, icon font, etc. or the arrow could just baked into the bg image on the select */
.dropdown::after {
content: "";
position: absolute;
width: 9px;
height: 8px;
top: 50%;
right: 1em;
margin-top: -4px;
z-index: 2;
background: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 12'%3E%3Cpolygon fill='rgb(102,102,102)' points='8,12 0,0 16,0'/%3E%3C/svg%3E") 0 0 no-repeat;
/* These hacks make the select behind the arrow clickable in some browsers */
pointer-events: none;
}
/* This hides native dropdown button arrow in IE 10/11+ so it will have the custom appearance, IE 9 and earlier get a native select */
#media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {
.dropdown select::-ms-expand {
display: none;
}
/* Removes the odd blue bg color behind the text in IE 10/11 and sets the text to match the focus style text */
select:focus::-ms-value {
background: transparent;
color: #222;
}
}
/* Firefox >= 2 -- Older versions of FF (v2 - 6) won't let us hide the native select arrow, so we'll just hide the custom icon and go with native styling */
/* Show only the native arrow */
body:last-child .dropdown::after,
x:-moz-any-link {
display: none;
}
/* reduce padding */
body:last-child .dropdown select,
x:-moz-any-link {
padding-right: .8em;
}
/* Firefox 7+ -- Will let us hide the arrow, but inconsistently (see FF 30 comment below). We've found the simplest way to hide the native styling in FF is to make the select bigger than its container. */
/* The specific FF selector used below successfully overrides the previous rule that turns off the custom icon; other FF hacky selectors we tried, like `*>.dropdown::after`, did not undo the previous rule */
/* Set overflow:hidden on the wrapper to clip the native select's arrow, this clips hte outline too so focus styles are less than ideal in FF */
_::-moz-progress-bar,
body:last-child .dropdown {
overflow: hidden;
}
/* Show only the custom icon */
_::-moz-progress-bar,
body:last-child .dropdown:after {
display: block;
}
_::-moz-progress-bar,
body:last-child .dropdown select {
/* increase padding to make room for menu icon */
padding-right: 1.9em;
/* `window` appearance with these text-indent and text-overflow values will hide the arrow FF up to v30 */
-moz-appearance: window;
text-indent: 0.01px;
text-overflow: "";
/* for FF 30+ on Windows 8, we need to make the select a bit longer to hide the native arrow */
width: 110%;
}
/* At first we tried the following rule to hide the native select arrow in Firefox 30+ in Windows 8, but we'd rather simplify the CSS and widen the select for all versions of FF since this is a recurring issue in that browser */
/* #supports (-moz-appearance:meterbar) and (background-blend-mode:difference,normal) {
.dropdown select { width:110%; }
} */
/* Firefox 7+ focus style - This works around the issue that -moz-appearance: window kills the normal select focus. Using semi-opaque because outline doesn't handle rounded corners */
_::-moz-progress-bar,
body:last-child .dropdown select:focus {
outline: 2px solid rgba(180, 222, 250, .7);
}
/* Opera - Pre-Blink nix the custom arrow, go with a native select button */
x:-o-prefocus,
.dropdown::after {
display: none;
}
/* Hover style */
.dropdown:hover {
border: 1px solid #888;
}
/* Focus style */
select:focus {
outline: none;
box-shadow: 0 0 1px 3px rgba(180, 222, 250, 1);
background-color: transparent;
color: #222;
border: 1px solid #aaa;
}
/* Firefox focus has odd artifacts around the text, this kills that */
select:-moz-focusring {
color: transparent;
text-shadow: 0 0 0 #000;
}
option {
font-weight: normal;
}
/* These are just demo button-y styles, style as you like */
.button {
border: 1px solid #bbb;
border-radius: .3em;
box-shadow: 0 1px 0 1px rgba(0, 0, 0, .04);
background: #f3f3f3;
/* Old browsers */
background: -moz-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ffffff), color-stop(100%, #e5e5e5));
/* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffffff 0%, #e5e5e5 100%);
/* IE10+ */
background: linear-gradient(to bottom, #ffffff 0%, #e5e5e5 100%);
/* W3C */
}
.output {
margin: 0 auto;
padding: 1em;
}
.colors {
padding: 2em;
color: #fff;
display: none;
}
.red {
background: #c04;
}
.yellow {
color: #000;
background: #f5e000;
}
.blue {
background: #079;
}
footer {
margin: 5em auto 3em;
padding: 2em 2.5%;
text-align: center;
}
a {
color: #c04;
text-decoration: none;
}
a:hover {
color: #903;
text-decoration: underline;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<label class="wrapper" for="states">This label is stacked above the select</label>
<div class="button dropdown">
<select id="colorselector">
<option value="red">Red</option>
<option value="yellow">Yellow</option>
<option value="blue">Blue</option>
</select>
</div>
<div class="output">
<div id="red" class="colors red"> “Good artists copy, great artists steal” Pablo Picasso</div>
<div id="yellow" class="colors yellow"> “Art is the lie that enables us to realize the truth” Pablo Picasso</div>
<div id="blue" class="colors blue"> “If I don't have red, I use blue” Pablo Picasso</div>
</div>

Inline CSS for linear gradient for a HTML.ActionLink button is not recognized Chrome

I tried to add gradient background color to my action link button:
<p>#Html.ActionLink("Call Cell Phone", "Call", new { id = Model.Id, number = Model.CellNumber }, new { #class = "btn btn-default", #style = "background-color:-webkit-linear-gradient(top, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%);", onclick = "Call('PrimaryNumber');" })</p>
it is generated into:
<a class="btn btn-default" href="/Person/Call/2?number=113-456-789" onclick="Call('PrimaryNumber');" style="background-color:-webkit-linear-gradient(top, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%);">Call Cell Phone</a>
and Chrome indicates that it does not understand gradient part:
I used corolzilla to generate this gradient. I also got other versions. Trued both described as for Chrome
background: #f8ffe8; /* Old browsers */
background: -moz-linear-gradient(top, #f8ffe8 0%, #e3f5ab 33%, #b7df2d 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8ffe8), color-stop(33%,#e3f5ab), color-stop(100%,#b7df2d)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%); /* IE10+ */
background: linear-gradient(to bottom, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f8ffe8', endColorstr='#b7df2d',GradientType=0 ); /* IE6-9 */
How to fix this gradient to make Chrome recognize it.
linear-gradient() function is supposed to create an <image> CSS data type. You should use that function within either background or background-image property.
For instance:
background-image: -webkit-linear-gradient(top, #f8ffe8 0%,#e3f5ab 33%,#b7df2d 100%);

can't import local jquery.mobile-1.3.1.js

I need to use a local jquery.mobile-1.3.1.js (not http, from the internet, because of custon themes I have desighned).
But now I don't have jquery mobile items (popup and slider for example).
My application is phonegap and has cordova-2.6.0.js file.
Here are the links at the head of index.html:
(I do not use jquery.mobile-1.3.1.css because I want to use my themes)
<meta http-equiv="X-UA-Compatible" content="IE=10" />
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<!--<meta name="viewport" content="width=device-width, initial-scale=1">-->
<script src="jquery-1.9.1.js"></script>
<script src="jquery.mobile-1.3.1.js"></script>
<script type="text/javascript" src="cordova-2.6.0.js"></script>
<link rel="stylesheet" href="C:\Users\rv\workspace\test1\assets\www\css\themes\SensorsTheme.css" />
<link rel="stylesheet" href="jquery.mobile.structure-1.3.1.css" />
<!--<link rel="stylesheet" href="C:\Users\r\workspace\test1\assets\www\jquery.mobile-1.3.1.css" />-->
<link rel="stylesheet" type="text/css" href="css/index.css" />
And here is the popup that doesn't seem well:
function aboutPopup(popupHeader, popupContent) {
var $aboutPopup = $("<div/>").popup({
theme: "c",
dismissible: false,
});
//create a title for the popup
$("<h2/>", {
text: popupHeader
}).appendTo($aboutPopup);
//create a content for the popup
$("<h3/>", {
}).html(popupContent).appendTo($aboutPopup);
This is the theme.css I've created by ThemeRoller tool of jquery mobile:
ui-bar-a {
border: 1px solid #ffffff /*{a-bar-border}*/;
background: #006FD0 /*{a-bar-background-color}*/;
color: #ffffff /*{a-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{a-bar-shadow-x}*/ 1px /*{a-bar-shadow-y}*/ 0 /*{a-bar-shadow-radius}*/ #444444 /*{a-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #007ae4 /*{a-bar-background-start}*/), to( #0063bb /*{a-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #007ae4 /*{a-bar-background-start}*/, #0063bb /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #007ae4 /*{a-bar-background-start}*/, #0063bb /*{a-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #007ae4 /*{a-bar-background-start}*/, #0063bb /*{a-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #007ae4 /*{a-bar-background-start}*/, #0063bb /*{a-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #007ae4 /*{a-bar-background-start}*/, #0063bb /*{a-bar-background-end}*/);
}
.ui-bar-a .ui-link-inherit {
color: #ffffff /*{a-bar-color}*/;
}
.ui-bar-a a.ui-link {
color: #7cc4e7 /*{a-bar-link-color}*/;
font-weight: bold;
}
.ui-bar-a a.ui-link:visited {
color: #2489ce /*{a-bar-link-visited}*/;
}
.ui-bar-a a.ui-link:hover {
color: #2489ce /*{a-bar-link-hover}*/;
}
.ui-bar-a a.ui-link:active {
color: #2489ce /*{a-bar-link-active}*/;
}
.ui-bar-a,
.ui-bar-a input,
.ui-bar-a select,
.ui-bar-a textarea,
.ui-bar-a button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-a,
.ui-overlay-a {
border: 1px solid #ffffff /*{a-body-border}*/;
color: #ffffff /*{a-body-color}*/;
background: #006FD0 /*{a-body-background-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #006fd0 /*{a-body-background-start}*/), to( #006fd0 /*{a-body-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #006fd0 /*{a-body-background-start}*/, #006fd0 /*{a-body-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #006fd0 /*{a-body-background-start}*/, #006fd0 /*{a-body-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #006fd0 /*{a-body-background-start}*/, #006fd0 /*{a-body-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #006fd0 /*{a-body-background-start}*/, #006fd0 /*{a-body-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #006fd0 /*{a-body-background-start}*/, #006fd0 /*{a-body-background-end}*/);
}
.ui-overlay-a {
background-image: none;
border-width: 0;
}
.ui-body-a,
.ui-body-a input,
.ui-body-a select,
.ui-body-a textarea,
.ui-body-a button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-body-a .ui-link-inherit {
color: #ffffff /*{a-body-color}*/;
}
.ui-body-a .ui-link {
color: #ffffff /*{a-body-link-color}*/;
font-weight: bold;
}
.ui-body-a .ui-link:visited {
color: #9273c4 /*{a-body-link-visited}*/;
}
.ui-body-a .ui-link:hover {
color: #c3e0f9 /*{a-body-link-hover}*/;
}
.ui-body-a .ui-link:active {
color: #9273c4 /*{a-body-link-active}*/;
}
.ui-btn-up-a {
border: 1px solid #cccccc /*{a-bup-border}*/;
background: #eeeeee /*{a-bup-background-color}*/;
font-weight: bold;
color: #2f3e46 /*{a-bup-color}*/;
text-shadow: 0 /*{a-bup-shadow-x}*/ 1px /*{a-bup-shadow-y}*/ 0 /*{a-bup-shadow-radius}*/ #ffffff /*{a-bup-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #ffffff /*{a-bup-background-start}*/), to( #f1f1f1 /*{a-bup-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #ffffff /*{a-bup-background-start}*/, #f1f1f1 /*{a-bup-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #ffffff /*{a-bup-background-start}*/, #f1f1f1 /*{a-bup-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #ffffff /*{a-bup-background-start}*/, #f1f1f1 /*{a-bup-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #ffffff /*{a-bup-background-start}*/, #f1f1f1 /*{a-bup-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #ffffff /*{a-bup-background-start}*/, #f1f1f1 /*{a-bup-background-end}*/);
}
.ui-btn-up-a:visited,
.ui-btn-up-a a.ui-link-inherit {
color: #2f3e46 /*{a-bup-color}*/;
}
.ui-btn-hover-a {
border: 1px solid #bbbbbb /*{a-bhover-border}*/;
background: #dfdfdf /*{a-bhover-background-color}*/;
font-weight: bold;
color: #2f3e46 /*{a-bhover-color}*/;
text-shadow: 0 /*{a-bhover-shadow-x}*/ 1px /*{a-bhover-shadow-y}*/ 0 /*{a-bhover-shadow-radius}*/ #ffffff /*{a-bhover-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #f6f6f6 /*{a-bhover-background-start}*/), to( #e0e0e0 /*{a-bhover-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #f6f6f6 /*{a-bhover-background-start}*/, #e0e0e0 /*{a-bhover-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #f6f6f6 /*{a-bhover-background-start}*/, #e0e0e0 /*{a-bhover-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #f6f6f6 /*{a-bhover-background-start}*/, #e0e0e0 /*{a-bhover-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #f6f6f6 /*{a-bhover-background-start}*/, #e0e0e0 /*{a-bhover-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #f6f6f6 /*{a-bhover-background-start}*/, #e0e0e0 /*{a-bhover-background-end}*/);
}
.ui-btn-hover-a:visited,
.ui-btn-hover-a:hover,
.ui-btn-hover-a a.ui-link-inherit {
color: #2f3e46 /*{a-bhover-color}*/;
}
.ui-btn-down-a {
border: 1px solid #bbbbbb /*{a-bdown-border}*/;
background: #d6d6d6 /*{a-bdown-background-color}*/;
font-weight: bold;
color: #2f3e46 /*{a-bdown-color}*/;
text-shadow: 0 /*{a-bdown-shadow-x}*/ 1px /*{a-bdown-shadow-y}*/ 0 /*{a-bdown-shadow-radius}*/ #ffffff /*{a-bdown-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #d0d0d0 /*{a-bdown-background-start}*/), to( #dfdfdf /*{a-bdown-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #d0d0d0 /*{a-bdown-background-start}*/, #dfdfdf /*{a-bdown-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #d0d0d0 /*{a-bdown-background-start}*/, #dfdfdf /*{a-bdown-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #d0d0d0 /*{a-bdown-background-start}*/, #dfdfdf /*{a-bdown-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #d0d0d0 /*{a-bdown-background-start}*/, #dfdfdf /*{a-bdown-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #d0d0d0 /*{a-bdown-background-start}*/, #dfdfdf /*{a-bdown-background-end}*/);
}
.ui-btn-down-a:visited,
.ui-btn-down-a:hover,
.ui-btn-down-a a.ui-link-inherit {
color: #2f3e46 /*{a-bdown-color}*/;
}
.ui-btn-up-a,
.ui-btn-hover-a,
.ui-btn-down-a {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
text-decoration: none;
}
Thanks a lot for helping me!

How to add custom data-theme swatches without overriding the deafault ones?

Using Themeroller I can make my own color theme to be used instead of the default one. But I want to add a couple of data-theme swatches (e.g. "f" and "g") and use them with the default ones. Can I do it with the Themeroller?
If you look at jquery mobile's css file , you'd see a structure like this :
/* Swatches */
/* A ---------------------------------------------*/
.ui-bar-a {
border: 1px solid #333 /*{a-bar-border}*/;
background: #111 /*{a-bar-background-color}*/;
color: #fff /*{a-bar-color}*/;
font-weight: bold;
text-shadow: 0 /*{a-bar-shadow-x}*/ -1px /*{a-bar-shadow-y}*/ 0 /*{a-bar-shadow-radius}*/ #000 /*{a-bar-shadow-color}*/;
background-image: -webkit-gradient(linear, left top, left bottom, from( #3c3c3c /*{a-bar-background-start}*/), to( #111 /*{a-bar-background-end}*/)); /* Saf4+, Chrome */
background-image: -webkit-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Chrome 10+, Saf5.1+ */
background-image: -moz-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* FF3.6 */
background-image: -ms-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* IE10 */
background-image: -o-linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/); /* Opera 11.10+ */
background-image: linear-gradient( #3c3c3c /*{a-bar-background-start}*/, #111 /*{a-bar-background-end}*/);
}
.ui-bar-a,
.ui-bar-a input,
.ui-bar-a select,
.ui-bar-a textarea,
.ui-bar-a button {
font-family: Helvetica, Arial, sans-serif /*{global-font-family}*/;
}
.ui-bar-a .ui-link-inherit {
color: #fff /*{a-bar-color}*/;
}
.ui-bar-a a.ui-link {
color: #7cc4e7 /*{a-bar-link-color}*/;
font-weight: bold;
}
...
/* B -----------------------------------------*/
...
/* C -----------------------------------------*/
...
/* D -----------------------------------------*/
...
/* E -----------------------------------------*/
...
/* Structure */
/* links within "buttons" -----------------------*/
You could add theme "f" (or whatever you want to name it) before /* Structure */, or in a separate CSS file referenced after jQM's css. This will not affect the previous styles. But be sure to name the elements this way :
.ui-bar-themename
Else, you'll over ride the existing styles.
In Themeroller I added additional styles for letters F and G and tuned them as I needed (A - E were left untouched). Then I downloaded the zip file with styles, copied the /* F and /* G sections (thanks to #hungerpain), put them in a separate .css and linked it after the jQM .css.
All jquery mobile themes executed by jquery-mobile.js files. In .js files defined only 5 themes. A and B and C and D and E.
if you want to add your custom theme for example "F" in to this group themes, you should add this themes id in to jquery-mobile.js for executing. do you undrestand?
In simple case you can made your custom theme by chenging in for example "A" or "B" themes parameters.

CSS gradient not working on iOS

I have created a gradient background using a CSS generator. This works perfectly in all major browsers and on Android. However in iOS i get this.
What do I need to add to this gradient in order to make it working on iOS?
Edit: Because this question isn't gaining enough attention, I'd like to ask a different question: What do I need for css tag to create a linear gradient for safari/ios, when, as in this case, -webkit-linear-gradient is not working? Are there any other css gradient tags, specifically for safari?
Here's the code for my background:
.gradient {
/* Legacy browsers */
background: #FF7701 url("gradient-bg.png") repeat-x top;
-o-background-size: 100% 100%;
-moz-background-size: 100% 100%;
-webkit-background-size: 100% 100%;
background-size: 100% 100%;
/* Internet Explorer */
*background: #FF7701;
background: #FF7701\0/;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="gradient-bg.png", sizingMethod="scale");
}
#media all and (min-width: 0px) {
.gradient {
/* Opera */
background: #FF7701 url("gradient-bg.svg");
/* Recent browsers */
background-image: -webkit-gradient(
linear,
left top, left bottom,
from(#FFAD26),
to(#FF7701),
color-stop(0.5, #FEA026),
color-stop(0.5, #FFFFFF),
color-stop(0.5, #FFFFFF),
color-stop(0.5, #FFFFFF),
color-stop(0.5, #FF8B00)
);
background-image: -webkit-linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
background-image: -moz-linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
background-image: -o-linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
background-image: linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
}
}
In mobile Safari at least, you can't use the keyword transparent, you have to use rgba(255, 255, 255, 0) instead.
This is described here: https://developer.apple.com/library/safari/documentation/internetweb/conceptual/safarivisualeffectsprogguide/Gradients/Gradient.html
As you can see, even in Apple's own official document, rgba(255, 255, 255, 0) is used instead of transparent.
Do give this a check in iOS but it ought to work:
background: #ffad26; /* Old browsers */
background: -moz-linear-gradient(top, #ffad26 0%, #fea026 50%, #ff8b00 51%, #ff7701 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffad26), color-stop(50%,#fea026), color-stop(51%,#ff8b00), color-stop(100%,#ff7701)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #ffad26 0%,#fea026 50%,#ff8b00 51%,#ff7701 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #ffad26 0%,#fea026 50%,#ff8b00 51%,#ff7701 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #ffad26 0%,#fea026 50%,#ff8b00 51%,#ff7701 100%); /* IE10+ */
background: linear-gradient(to bottom, #ffad26 0%,#fea026 50%,#ff8b00 51%,#ff7701 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffad26', endColorstr='#ff7701',GradientType=0 ); /* IE6-9 */
I'd also recommend looking into a pre-processor like SASS which will generate a lot of these things for you.
Alternative 1
As an alternative, you could try using an inset box shadow. It's not exact, and it has it's limitations but it's just an option :)
background-color:#FF8B00;
-webkit-box-shadow: inset 0px 100px 0px 0px rgba(255, 255, 255, 0.5);
box-shadow: inset 0px 100px 0px 0px rgba(255, 255, 255, 0.5);
Alternative 2
If you know the height, either use the box shadow above or just use a background image. That way you'll get cross-browser support without the mess that is a hundred prefixed CSS properties like above :)
Working DEMO here http://jsfiddle.net/yeyene/akRHX/
And its iPhone screenshot...
add your css class to the element.
HTML
<div data-role="page">
<div data-role="header">
<h1>Page Title</h1>
</div><!-- /header -->
<div data-role="content">
<div class="ui-grid-a">
<div class="ui-block-a"><div class="ui-bar gradient" style="height:200px">Block A</div></div>
<div class="ui-block-b"><div class="ui-bar gradient" style="height:200px">Block B</div>
</div>
</div><!-- /grid-a -->
</div><!-- /content -->
</div><!-- /page -->
CSS
.gradient {
/* Legacy browsers */
background: #FF7701 url("gradient-bg.png") repeat-x top;
-o-background-size: 100% 100%;
-moz-background-size: 100% 100%;
-webkit-background-size: 100% 100%;
background-size: 100% 100%;
/* Internet Explorer */
*background: #FF7701;
background: #FF7701\0/;
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="gradient-bg.png", sizingMethod="scale");
}
#media all and (min-width: 0px) {
.gradient {
/* Opera */
background: #FF7701 url("gradient-bg.svg");
/* Recent browsers */
background-image: -webkit-gradient(
linear,
left top, left bottom,
from(#FFAD26),
to(#FF7701),
color-stop(0.5, #FEA026),
color-stop(0.5, #FFFFFF),
color-stop(0.5, #FFFFFF),
color-stop(0.5, #FFFFFF),
color-stop(0.5, #FF8B00)
);
background-image: -webkit-linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
background-image: -moz-linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
background-image: -o-linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
background-image: linear-gradient(
top,
#FFAD26,
#FEA026 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FFFFFF 50%,
#FF8B00 50%,
#FF7701
);
}
}
For me the following worked and this worked for me in desktop browser, android and ios:-
display: list-item;
background-image: linear-gradient(45deg, #2b4bff, #1b681f);
background-clip: text;
color: rgba(255, 255, 255, 0);
I was using display:flex and that did not work and I had to change
to list-item.
Color I was using 'transparent' and now I am using
rgba(255, 255, 255, 0)
Some helpful notes:
The property background-clip: text; only works in Safari when applied directly to the element you want styled. You cannot apply it to a parent element and style all children at once. (This does work in Chrome and Firefox)
enter link description here

Resources