View dark7.js
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) => { |
View dark6.css
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; | |
} |
View dark4.js
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; |
View dark5.js
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'); | |
} |
View dark2.html
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> |
View dark.css
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; | |
} |
View gist:925a183619376feb5dcf5de9a84bcdd8
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'; | |
}); |
View gist:4bcfce7f1ff341f9b1ad8cc98b3417bb
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'); |
View add-cart-email-form.php
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). | |
* |
View wc-custom-meta-get.php
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