From d794e285ab966391b508b8df618a9b2fe72b572d Mon Sep 17 00:00:00 2001 From: Jihye Hong Date: Sun, 1 Jul 2018 17:45:07 +0900 Subject: [PATCH] Add using registerProperty - Register the syntax of "--spatial-navigation-contain' --- polyfill/spatnav-api.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/polyfill/spatnav-api.js b/polyfill/spatnav-api.js index 36b5d8aeb32..d40c68bf33b 100644 --- a/polyfill/spatnav-api.js +++ b/polyfill/spatnav-api.js @@ -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