GithubHelp home page GithubHelp logo

css3-notes's Introduction

CSS3-Notes

Book: CSS3 for Web Designers

Before diving too deep into this book, I had to keep in mind that this book was published in 2015 (The Second Edition)

What have a learned so far?

June 2011, CSS3 was introduced to modern web browsers. According to the book, CSS3 is a series of modules that are designed to be implemented separately and independently from each other. This segmented approach has enabled portions of the spec to move faster for others and has encouraged browser vendors to implement the pieces that are further along before the entirety of CSS3 is considered finished.

CSS3 targets the experience layer. Previously, CSS focused on the critical aspects of UI (Layout, type, color, etc.) while CSS3 is introducing the experience layer to the game (animations, feedback, movement -- previously left to technologies like Flash and JavaScript)

Critical Non-Critical
Branding Interaction
Usability Visual Rewards
Accessibility Feedback
Layout Movement

CSS3 properties that are usable today

  • Border-radius
  • text-shadow
  • box-shadow
  • box-sizing
  • multiple background images
  • opacity
  • RGBA
  • More at W3C.org

Creating delightful experiences with CSS3

Since CSS3 properties are not supported in all browsers, it may be a little difficult to support identifical experiences. http://dowebsitesneedtobeexperiencedexactlythesameineverybrowser.com/

There is a way to create faternal experiences with vendor prefixes and strategic CSS placement.

My favorite part about this chapter discussed the need to place vendor prefixes before any finalized property so that we create backup if a browser doesn't support it.

For example:

#nav li a {
  padding: 5px 15px;
  font-weight: bold;
  color: #ccc;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
}

For example, border-radius is placed at the bottom while the vendor prefixes for border-radius is above. We want our browser to use border-radius first, however, if there is no support, it falls back to the vendor prefixes. If the vendor prefixes are not available, nothing will show at all.

Same with RGBA color. If RGBA is not support, it falls back to the normal color: #ccc because all browsers support that.

Adding transitions

Always add the transition properties to the normal state of the elemt to be transitioned. Transtions are designed this way in order for the transition to happen not only on one experience (ex: :hover), but also :focus and :active states.

Example:

#nav li a {
  padding: 5px 15px;
  font-weight: bold;
  color: #ccc;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
  -webkit-border-radius: 50%;
  -moz-border-radius: 50%;
  border-radius: 50%;
  -webkit-transition: all 0.3s ease-in-out;
  -moz-transition: all 0.3s ease-in-out;
  -o-transition: all 0.3s ease-in-out;
  transition: all 0.3s ease-in-out;
}

#nav li a:hover,
#nav li a:focus {
  color: #fff;
  background: rgba(255. 255, 255, 0.15);
}

Transforms and Translates

css3-notes's People

Contributors

lenoraporter avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.