From 79024f0098567c40dcffc77ee23c87cc91c63715 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Tue, 6 Aug 2013 21:29:15 +0200 Subject: [PATCH] separate options page css --- badged.php | 18 ++++++++++++--- css/badged-menu.css | 53 --------------------------------------------- css/options.css | 51 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 56 deletions(-) create mode 100644 css/options.css diff --git a/badged.php b/badged.php index de498ce..81c4a46 100644 --- a/badged.php +++ b/badged.php @@ -45,26 +45,38 @@ if (function_exists('load_plugin_textdomain')) { } +/** + * Plugin version, used for cache-busting of style and script file references. + * + * @since 1.0.0 + * + * @var string + */ +$version = '1.0.0'; + + /** * Register the styles depending on options * */ function badged_init() { badged_register_settings(); + wp_enqueue_style( 'badged-admin-styles', plugins_url( 'css/options.css', BADGED_PLUGIN_FILE), false, $version ); + if ( get_option('menu') == 'yes') { - wp_register_style('badged-menu-css', plugins_url('css/badged-menu.css', BADGED_PLUGIN_FILE), false, '9001'); + wp_register_style('badged-menu-css', plugins_url('css/badged-menu.css', BADGED_PLUGIN_FILE), false, $version); wp_enqueue_style('badged-menu-css'); } if ( get_option('bar') == 'yes') { - wp_register_style('badged-bar-css', plugins_url('css/badged-bar.css', BADGED_PLUGIN_FILE), false, '9001'); + wp_register_style('badged-bar-css', plugins_url('css/badged-bar.css', BADGED_PLUGIN_FILE), false, $version); wp_enqueue_style('badged-bar-css'); } } function badged_bar_only_init() { if ( get_option('bar') == 'yes') { - wp_register_style('badged-bar-css', plugins_url('css/badged-bar.css', BADGED_PLUGIN_FILE), false, '9001'); + wp_register_style('badged-bar-css', plugins_url('css/badged-bar.css', BADGED_PLUGIN_FILE), false, $version); wp_enqueue_style('badged-bar-css'); } } diff --git a/css/badged-menu.css b/css/badged-menu.css index 32e2379..5edfd41 100644 --- a/css/badged-menu.css +++ b/css/badged-menu.css @@ -91,59 +91,6 @@ } -/* ============================================================== */ -/* The Options Page */ -/* ============================================================== */ - -#badgedoptions a, -input.button-primary { - text-decoration: none; - -webkit-transition: all .2s ease-in-out 0s; - -moz-transition: all .2s ease-in-out 0s; - -o-transition: all .2s ease-in-out 0s; - -ms-transition: all .2s ease-in-out 0s; - transition: all .2s ease-in-out 0s; -} - -#badgedoptions form h2 { - border-bottom: 1px solid #eee; - border-top: 1px solid #eee; - margin-top: .5em; - padding: 10px 0; -} - -#badgedoptions footer { - border-top: 1px solid #eee; - color: #666; -} - -#badgedoptions .icon32 { - background-image: url(../img/icon-badged-32.png); - background-repeat: no-repeat; -} - -#badgedoptions p.submit { - background: #fcfcfc; - padding: .7em .5em; - border-top: 1px solid #f7f7f7; - margin-top: 4em; - margin-bottom: 3em; -} - -@media -only screen and (-webkit-min-device-pixel-ratio: 1.5), -only screen and ( min--moz-device-pixel-ratio: 1.5), -only screen and ( -o-min-device-pixel-ratio: 3/2), -only screen and ( min-device-pixel-ratio: 1.5) { - #badgedoptions .icon32 { - background-image: url(../img/icon-badged-32@2x.png) !important; - -webkit-background-size: 32px 32px; - -moz-background-size: 32px 32px; - background-size: 32px 32px; - } -} - - /* ============================================================== */ /* IE 8 Only Styles */ /* ============================================================== */ diff --git a/css/options.css b/css/options.css new file mode 100644 index 0000000..70b5a84 --- /dev/null +++ b/css/options.css @@ -0,0 +1,51 @@ +/* ============================================================== */ +/* The Options Page */ +/* ============================================================== */ + +#badgedoptions a, +input.button-primary { + text-decoration: none; + -webkit-transition: all .2s ease-in-out 0s; + -moz-transition: all .2s ease-in-out 0s; + -o-transition: all .2s ease-in-out 0s; + -ms-transition: all .2s ease-in-out 0s; + transition: all .2s ease-in-out 0s; +} + +#badgedoptions form h2 { + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + margin-top: .5em; + padding: 10px 0; +} + +#badgedoptions footer { + border-top: 1px solid #eee; + color: #666; +} + +#badgedoptions .icon32 { + background-image: url(../img/icon-badged-32.png); + background-repeat: no-repeat; +} + +#badgedoptions p.submit { + background: #fcfcfc; + padding: .7em .5em; + border-top: 1px solid #f7f7f7; + margin-top: 4em; + margin-bottom: 3em; +} + +@media +only screen and (-webkit-min-device-pixel-ratio: 1.5), +only screen and ( min--moz-device-pixel-ratio: 1.5), +only screen and ( -o-min-device-pixel-ratio: 3/2), +only screen and ( min-device-pixel-ratio: 1.5) { + #badgedoptions .icon32 { + background-image: url(../img/icon-badged-32@2x.png) !important; + -webkit-background-size: 32px 32px; + -moz-background-size: 32px 32px; + background-size: 32px 32px; + } +} \ No newline at end of file