This file contains 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
let matched = window.matchMedia('(prefers-color-scheme: dark)').matches; | |
if(matched) { | |
console.log('User has Dark mode'); | |
} | |
else { | |
console.log('User has not enable Dark mode'); | |
} |
This file contains 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
<?php | |
/** | |
* Turn all URLs in clickable links. | |
* | |
* @param string $value | |
* @param array $protocols http/https, ftp, mail, twitter | |
* @param array $attributes | |
* @return string | |
*/ | |
public function linkify($value, $protocols = array('http', 'mail'), array $attributes = array()) |