On 30 Jan 2015, 11:52 am, tonzodehoo wrote:
Hello Ern,
I just wanted to check these lines from what you had written regards the extended style.
"That last one can still use browser-specific fallbacks, so can be written in FWP Extended styles as:
NAME: -webkit-background-size VALUE: cover;-moz-background-size:
cover;-o-background-size: cover;background-size: cover
( It was earlier last year when I wrote this, and since then it seems these vendor prefixes for this code are no longer needed. background-size: cover;
is now standard for current browsers, so all you have to worry about is
NAME: background-size VALUE: cover
Yet, let me continue anyway explaining this technique of mine to force Freeway to write CSS properties in order, for the sake of future questions.
The order in which CSS code gets written is very important-- it’s part of what is called The Cascade Order. When CSS code is written out of the Cascade order, it can weaken or even change the intent of the code.
Since Freeway does not let us set the order in which our custom CSS is written, we have to find ways to do this on our own. This bit of code you’re pointing at is using what are called vendor prefixes
to tell specific browsers how to interpret this code.
Vendor prefixes and browser “hacks” follow the same logic CSS code writers have been using since forever to control the flow of styles to the user. It’s like saying
“Here’s a style code, and if you don’t understand it, here’s another style code… and if you didn’t get that one, here’s yet another variation…”
essentially until all conditions are met the way the designer intends for them to be. I would write the CSS for this like
.mystyle {
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover
}
In this order, the style starts with webkit
browsers, like Safari and Chrome… then moves on to mozilla
browsers (e.g., Firefox), then Opera. The final fallback is to the official style designation… so that browsers that don’t recognize the official standard are taken care of first, and anything that does recognize the standard CSS is left unambiguously and unconflicted in its instruction.
Traditionally, each of these vendor-prefixed style declarations can be entered separately into Freeway’s Extended Style interface-- which is how we extend most styles. One property, one value… Freeway adds the colons, semicolons, and brackets for us. But the order in which Freeway writes each declaration is not something we can control this way. So the traditional way may well screw us over.
But we know that Freeway will put a colon after the property name… we know that Freeway will put a semicolon after the value we’ve entered (unless it’s the last value in the style definition, then Freeway lazily leaves it off, grumble, grumble) and finally, that Freeway will place brackets around the whole definition for that style.
So my technique here proposes that we add the extra properties and values in the Value field-- including the proper punctuation which Freeway will faithfully include like a good little robot-- and Freeway will write it down in the order we tell it to.
NAME:
-webkit-background-size
VALUE:
cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover
Bingo. As long as you’ve used proper CSS syntax, punctuation and spelling, Freeway is none the wiser and writes the final output code EXACTLY the way you want (except for that lazy last missing semicolon). The true beauty in this method is that you can now move on to more powerful orders of code magic without resorting to <head>
code or extra external stylesheets.
Not only can you get away with multiple style declarations in one Freeway Extended Style declaration, but you can also include whole other style definitions-- provided you’re not code shy. Face it, if you’re concerned about Cascade order, you’re not code shy.
Here’s an example of what I mean… I make a new style ovalshadow
and in the Extended Style window make a new attribute (only one, and only in the Extended window):
NAME:
text-align
VALUE:
center; }
.ovalshadow:hover { cursor: pointer; }
.ovalshadow:hover:after { bottom: 5px; }
.ovalshadow:after { z-index: -1; content: ''; width: 80%; height: 50%;
position: absolute; bottom: 10px; left: 0; right: 0; margin: auto;
background: none; border-radius: 50%; box-shadow: 0 15px 10px rgba(0, 0, 0, 0.3);
-webkit-transition: bottom 0.3s; -moz-transition: bottom 0.3s;
-o-transition: bottom 0.3s; transition: bottom 0.3s
There, I’ve not only defined my Freeway applicable style, but three others as well and Freeway will write them exactly in that order-- creating perfectly good code, placing a closing bracket at the end of the last definition thinking it’s still working with just the one.
Let’s be clear… this is an advanced technique, requiring some code skill and the unflinching will to jump Freeway through the flaming eyes of needles without a safety harness. It is an opportunity for World Class Disaster… but also for discovery, of a level of Freeway use that is unimaginable until you’re at that summit.
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options