Media: non-print or screen ?

This forum is for Single-Sourcing your Flare content to multiple outputs.
Post Reply
ajturnersurrey
Sr. Propeller Head
Posts: 346
Joined: Fri Nov 05, 2010 3:30 am

Media: non-print or screen ?

Post by ajturnersurrey »

I have a question that only comes about because I am approaching single-sourcing pdf and html5 top nav output from a history of mainly producing pdfs. As a result my default is print media and I have @media non-print defined for web-based outputs when needed.

All was well until responsive html5 appeared .... now the responsiveness all seems to be based on @media screen and since 'screen' and 'non-print' are allowed to be different things I get just some of my desired features, depending on whether I set my target to medium type 'non-print' or 'screen'.

So it seems like some sort of overhaul of my approach is needed, before I get too far down this path.

Before I start trying to reset my project to see itself as catering for print and screen options only, is there anything to gain from completely reversing my stylesheet approach so that default is screen, which is what always seems to be assumed in tutorials on the subject?
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Media: non-print or screen ?

Post by NorthEast »

ajturnersurrey wrote:Before I start trying to reset my project to see itself as catering for print and screen options only, is there anything to gain from completely reversing my stylesheet approach so that default is screen, which is what always seems to be assumed in tutorials on the subject?
In short, no - there's no reason to change what you're doing, because Flare mediums aren't actually used in the output. Flare uses mediums in a very different way to how 'conventional' media types are used in browsers/devices.

Using 'conventional' media types, the medium used is determined by the browser/device you're using. So, if you're viewing a page in a browser, it will use the 'screen' media type; if you print the page to a printer, it uses the 'print' media type; if you're using a text-to-speech system, it'll use the 'aural' media.
If you're using responsive design, you normally use media queries with min/max-width properties to set your breakpoints. The media query might also include the 'screen' media, but that's not strictly necessary.

Now, media types in Flare are used in a fundamentally different way. Typically you'll set up your mediums in your stylesheet, and then choose a medium to use in your target.
But, the important thing to note is that the Flare output does not use mediums - the medium is not actually being used like conventional media types in your output.

To better explain what happens, say you have styles in your source stylesheet 'non-print' medium like this:

Code: Select all

@media non-print 
{
	body 
	{
		background-color: red;
	}
}

If you build the target with the 'non-print' medium set, the same stylesheet will actually look like this in the output:

Code: Select all

@media non-print 
{
	body 
	{
		background-color: red;
	}
}

body 
{
    background-color: red;
}
Flare has simply just copied all the styles from the non-print media, and appended these to the end of your stylesheet (which means they'll take precedence over anything earlier in the stylesheet).
So, your browser is just displaying the styles because they've been attached to the end (outside of the medium) - it isn't actually displaying any styles from within that non-print media section.

So, in summary, Flare mediums can be used to control what styles go in your output, but they can not be applied to the output itself like conventional media types.
ajturnersurrey
Sr. Propeller Head
Posts: 346
Joined: Fri Nov 05, 2010 3:30 am

Re: Media: non-print or screen ?

Post by ajturnersurrey »

Thanks for that - I was assuming media and medium were equivalent. It is becoming a little clearer now I see that they are not.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: Media: non-print or screen ?

Post by NorthEast »

ajturnersurrey wrote:Thanks for that - I was assuming media and medium were equivalent. It is becoming a little clearer now I see that they are not.
They terms 'medium' and 'media' (type) do mean the same thing. Flare just uses mediums/media differently to how they're conventionally used.
Post Reply