Last active
August 29, 2015 14:26
-
-
Save mishelen/0ebbf07a818d3a2a2366 to your computer and use it in GitHub Desktop.
В целом все также как @media дерективой, также есть host объект по которому можно проверять из js. Поддержка Edge, Safari 9, Лисе 23, Хроме 28, Мобильной опере 12.1, нет в Опере Мини, браузере Андроида и Мобильном ИЕ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @supports(prop:value) { | |
| /* more styles */ | |
| } | |
| @supports (display: flex) { | |
| div { display: flex; } | |
| } | |
| /*Возможно использование с ключевым словом not*/ | |
| @supports not (display: flex) { | |
| div { float: left; } /* alternative styles */ | |
| } | |
| /* А можно делать и множественные проверки */ | |
| /* or */ | |
| @supports (display: -webkit-flex) or | |
| (display: -moz-flex) or | |
| (display: flex) { | |
| /* use styles here */ | |
| } | |
| /* and */ | |
| @supports (display: flex) and (-webkit-appearance: caret) { | |
| } | |
| /* and and or */ | |
| @supports ((display: -webkit-flex) or | |
| (display: -moz-flex) or | |
| (display: flex)) and (-webkit-appearance: caret) { | |
| /* use styles here */ | |
| } | |
| /* В целом все также как @media дерективой*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var supportsCSS = !!((window.CSS && window.CSS.supports) || window.supportsCSS || false); | |
| var supportsFlex = CSS.supports("display", "flex"); | |
| // The second usage method includes simply providing the entire string to be parsed: | |
| var supportsFlexAndAppearance = CSS.supports("(display: flex) and (-webkit-appearance: caret)"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| section { | |
| float: left; | |
| } | |
| @supports (display: -webkit-flex) or | |
| (display: -moz-flex) or | |
| (display: flex) { | |
| section { | |
| display: -webkit-flex; | |
| display: -moz-flex; | |
| display: flex; | |
| float: none; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment