Skip to content

Commit

Permalink
Add using registerProperty
Browse files Browse the repository at this point in the history
- Register the syntax of "--spatial-navigation-contain'
  • Loading branch information
Jihye Hong committed Jul 1, 2018
1 parent ec29009 commit d794e28
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions polyfill/spatnav-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@
this._options = options;
}

/**
* CSS.registerProperty() from the Properties and Values API
* Reference: https://drafts.css-houdini.org/css-properties-values-api/#the-registerproperty-function
*/
if (window.CSS && CSS.registerProperty) {
console.log("registerProperty is available");
CSS.registerProperty({
name: '--spatial-navigation-contain',
syntax: 'auto | contain',
inherits: false,
initialValue: 'auto'
});
}

/**
* Gives a CSS custom property value applied at the element
* @function
Expand Down

0 comments on commit d794e28

Please sign in to comment.