What is a reserve?

I am not a native English speaker and I want to make sure I know what "backup" means. I have verified that it can refer to Plan B. More specifically, I read this sentence from the file To use REM and backup.

// Mixin: Font Size
//
// For using REM and a fallback
//
// usage:
// @include font-size(1.2);
//
@mixin font-size($sizeValue: 1.6) {
  font-size: ($sizeValue * 10) + px;
  font-size: $sizeValue + rem;
}

      

I also want to know what "standby" means in this context. "Fall" is one of two options? Are they using the Fallback Pattern?

+3


source to share


2 answers


Reverse example

Let's say you want to work with mediaqueries, but not every browser can handle it.

<link rel="stylesheet" media="all" href="fallback.css" />
<link rel="stylesheet" media="screen and (min-width: 900px)" href="advanced.css" />

      

So in this case every browser that cannot handle media queries will at least fall back to "fallback.css" and those that support media queries will load fallback.css AND advanced.css (keyword: progressive improvement )!

The same applies to the actual question, where font-size: ($sizeValue * 10) + px;

is the reserve for those browsers that do not support font-size: $sizeValue + rem;

. In short: browsers that don't support the rem

-unit value on CSS values
return the CSS value using the px

- block.

In this context, a return should provide a minimum state - so to speak ...


Some common return examples

  • When you declare CSS body{ font-family: super-fancy-font, Arial, sans-serif }

    , those that don't have the "super-fancy-font" installed fall back to "Arial", but again only if Arial is installed, otherwise you tell the browser to accept the standard sans-serif font.
  • If you use <noscript>

    -tag this is usually a fallback for browsers that don't support javascript. In this example, browsers that support javascript will not load the wrapped content <noscript>

    .

Returning example | "BBQ Mode" (for fun only)



Let's say you want to have a barbecue and you love to see the whole audience happy ! Remember those nice spare ribs from the last BBQ that you really enjoyed and put them on your list.

But wait; you remember some of your friends-friends (from the yoga course) are vegetarians and jepps that you don't need, you shouldn't disappoint your wives buddies, so let them have a reserve for those who don't like meat and put sticks mozarella to your list.

Suddenly you remember those Buddhist monks you invited last Sunday, when you asked them to come expecting them to say NO, but they agreed nonetheless. So have another supply for those who eat vegetarian and put lots of good vegetables and fruits on your list.

By now, you have your perfect BBQ setup:

  • Everyone can have delicious vegetables and fruits.
  • Anyone who knows how to eat cheese can have it.
  • And those who want to eat meat can also have it.

This way, each group has the appropriate supply and will have the best experience!


wikipedia.org

Refunds are a contingency option if a preferred option is not available. [...]

wiktionary.org

[...] an alternative that can be used if something goes wrong with the master plan [...]

+5


source


REM is the CSS unit for font sizes (I think according to your source) and fallback (in Sass or LESS) gets to work in all browsers ...



+2


source







All Articles