Last active
March 2, 2021 23:09
-
-
Save westonruter/35959595840823f77e4f85e584578bc3 to your computer and use it in GitHub Desktop.
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
#try-stylesheet-containing-closing-style-tag { | |
background-color: red; | |
} | |
#try-stylesheet-containing-closing-style-tag { | |
background-image: url( "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' viewBox='0 0 30 30' width='30' height='30'><title>AMP</title><defs><style>.circle{fill:white}.overlay{fill:blue;}</style></defs><g fill='none' fill-rule='evenodd'><path class='circle' d='M0 15c0 8.284 6.716 15 15 15 8.285 0 15-6.716 15-15 0-8.284-6.715-15-15-15C6.716 0 0 6.716 0 15z'/><path class='overlay' fill-rule='nonzero' d='M13.85 24.098h-1.14l1.128-6.823-3.49.005h-.05a.57.57 0 0 1-.568-.569c0-.135.125-.363.125-.363l6.272-10.46 1.16.005-1.156 6.834 3.508-.004h.056c.314 0 .569.254.569.568 0 .128-.05.24-.121.335L13.85 24.098zM15 0C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15 8.285 0 15-6.716 15-15 0-8.284-6.715-15-15-15z'/></g></svg>" ); | |
background-repeat: no-repeat; | |
background-color: lime; | |
background-position: bottom left; | |
background-size: 50px 50px; | |
height: 100px; | |
} |
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
#try-stylesheet-containing-closing-style-tag::after { | |
content: " FAIL!"; | |
color: red; | |
} | |
#try-stylesheet-containing-closing-style-tag::after { | |
content: " PASS! </style>"; | |
color: green; | |
} |
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 | |
/** | |
* Try Stylesheet Containing Closing Style Tag plugin bootstrap. | |
* | |
* @package Google\Try_Stylesheet_Containing_Closing_Style_Tags | |
* @author Weston Ruter, Google | |
* @license GPL-2.0-or-later | |
* @copyright 2021 Google Inc. | |
* | |
* @wordpress-plugin | |
* Plugin Name: Try Stylesheet Containing Closing Style Tags | |
* Plugin URI: https://gist.github.com/westonruter/35959595840823f77e4f85e584578bc3 | |
* Description: Test case for <a href="https://github.com/ampproject/amp-wp/pull/5937">amp-wp#5937</a>. | |
* Version: 0.1 | |
* Author: Weston Ruter, Google | |
* Author URI: https://weston.ruter.net/ | |
* License: GNU General Public License v2 (or later) | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html | |
* Gist Plugin URI: https://gist.github.com/westonruter/35959595840823f77e4f85e584578bc3 | |
*/ | |
namespace Google\Try_Stylesheet_Containing_Closing_Style_Tag; | |
add_action( | |
'wp_enqueue_scripts', | |
function () { | |
wp_enqueue_style( 'background-image-svg-data-url', plugin_dir_url( __FILE__ ) . '/background-image-svg-data-url.css', [], '1' ); | |
wp_enqueue_style( 'content-property', plugin_dir_url( __FILE__ ) . '/content-property.css', [], '1' ); | |
} | |
); | |
add_action( | |
'wp_footer', | |
function () { | |
?> | |
<div id="try-stylesheet-containing-closing-style-tag"> | |
<strong>Try Stylesheet Containing Closing Style Tag.</strong> | |
This should have an AMP logo background image as well as appearing to have a closing style tag. | |
</div> | |
<?php | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment