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
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)') { | |
var windowPrefersDark = window.matchMedia('(prefers-color-scheme: dark)'); | |
var systemColorMode = windowPrefersDark.matches ? 'dark' : 'light'; | |
// need to check in case doesn't exist like with Safari 13.x | |
if ( | |
'addEventListener' in windowPrefersDark && | |
typeof windowPrefersDark.addEventListener === 'function' | |
) { | |
windowPrefersDark.addEventListener('change', (event) => { |
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
:root.dark { | |
color-scheme: light dark; | |
} |
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
const dark = window.matchMedia && | |
window.matchMedia('(prefers-color-scheme: dark)') && | |
window.matchMedia('(prefers-color-scheme: dark)').matches; |
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
if (color_mode == 'dark') { | |
document.body.classList.add('dark'); | |
document.documentElement.classList.add('dark'); | |
} else { | |
document.body.classList.remove('dark'); | |
document.documentElement.classList.remove('dark'); | |
} |
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
<body class="dark"> | |
my app | |
</body> |
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
@media (prefers-color-scheme: dark) { | |
background: black; | |
} |
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
add_filter('metorik_acp_placement', function() { | |
return 'left'; | |
}); |
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
add_filter('metorik_acp_checkout_button', '__return_false'); |
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 | |
/** | |
* Metorik: Add cart email form template. | |
* | |
* This template can be overriden by copying this file to your-theme/metorik/add-cart-email-form.php | |
* | |
* Variables available: | |
* 1. $title - Title (set in Metorik). | |
* 2. $email_usage_notice - Email usage notice (if enabled in Metorik and customer didn't opt-out). | |
* |
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 | |
$order_id = 125; | |
echo get_post_meta( $order_id, 'payment_gateway_fee', true ); // 1.60 |
NewerOlder