Friday, 30 August 2013

Semantic CSS With Intelligent Selectors

http://coding.smashingmagazine.com/2013/08/20/semantic-css-with-intelligent-selectors/

Attribute selectors
[rel="prev"] {
  /* styling for "previous links" */
}

[rel="next"] {
  /* styling for "next" links */
}


Attribute selectors with simple Regex
a[href^="https:"] {
   /* style properties exclusive to secure pages */
}


[href$=".zip"]:before,
[href$=".gz"]:before {
   content: '\E004'; /* unicode for the zip folder icon */
}


An example of efficient CSS selectors with semantic HTML
/* BAD - The CSS for the class approach */

.new-window-icon:after {
   content: '[new window icon]';
}

.twitter-icon:before {
  content: '[twitter icon]';
}


/* GOOD - The CSS for the attribute selector approach */

[target="_blank"]:after {
   content: '[new window icon]';
}

[href*="twitter.com/"]:before {
  content: '[twitter icon]';
}


Specific selector using attribute
a {
  color: blue;
  text-decoration: underline;
}

a[rel="external"]:after {
   content: '[icon for external links]';
}



Rules for hyperlinks and buttons


  • Rule 1: “If it’s a hyperlink, it should have an href attribute.”
  • Rules 2: “If it’s a hyperlink and has an href attribute, it should have a valid value.”
  • Rules 3: “If it uses a button class, it should be a button — at least in the accessibility layer.”
  • Rules 4: “If it is an a element with role="button", then it should link to somewhere when JavaScript is off.”
  • Rules 5: “You can’t disable a hyperlink.”
  • Rules 6: “Buttons in forms should have explicit types.”
  • Rules 7:  “Both hyperlinks and buttons should have some sort of content or an ARIA label.”



Monday, 19 August 2013

HTML5 Please

http://html5please.com/

Look up HTML5, CSS3, etc features, know if they are ready for use, and if so find out how you should use them – with polyfills, fallbacks or as they are.

Friday, 16 August 2013

Animation with CSS

Animate.css - examples:
http://daneden.me/animate/

Client-Side Storage

http://tech.pro/blog/1486/client-side-storage-options

  • Web (Local & Session) Storage (current with limitations)
    For Local Storage usage example, you can see my post regarding HTML5 Contenteditable and KendoUI.
  • Indexed DB - e.g. idb.filesystem.js (near future)
  • File System - client (future!)
  • Web SQL (deprecated)

Potentially can develop a web-based app (supports mobile & desktop) without the need of an actual native mobile app.

Wednesday, 14 August 2013

IntelliJ - fix Maven dependency

Steps to go through fixing Maven dependency in IntelliJ -


  1. Check the POM - see if the dependency is defined properly
  2. Go to File --> Project Structure... and see if which Library is throwing up error
  3. Navigation to the Class file that the Library is pointing to, e.g. (in your Maven dir)
    [user_dir]/.m2/repository/[dependency]/[dependency_version]/... 
  4. Delete the Library with error in Project Structure.
  5. In command prompt, navigate to the directory of the project/Intellij module, run
    mvn install 
    to force download the dependencies
  6. In IntelliJ, top left hand corner, go to "Packages" view
  7. Right-click on the module --> Maven --> Reimport
  8. Go to File --> Project Structure... to see if error persist