Ticket #630: 630.diff
File 630.diff, 3.4 KB (added by , 11 years ago) |
---|
-
handbook/inc/callout-boxes.php
23 23 */ 24 24 public function __construct() { 25 25 $this->shortcodes = array( 26 'info' => __( 'Note :', 'wporg' ),27 'tip' => __( 'Tip :', 'wporg' ),28 'alert' => __( 'Alert :', 'wporg' ),29 'warning' => __( 'Warning :', 'wporg' )30 );26 'info' => __( 'Note', 'wporg' ), 27 'tip' => __( 'Tip', 'wporg' ), 28 'alert' => __( 'Alert', 'wporg' ), 29 'warning' => __( 'Warning', 'wporg' ) 30 ); 31 31 32 32 add_action( 'init', array( $this, 'register_shortcodes' ) ); 33 33 } … … 115 115 $class = sanitize_html_class( $shortcode ); 116 116 $class = empty( $class ) ? '' : "callout-{$class}"; 117 117 118 // Message prefix.119 $prefix = '<strong>' . $this->shortcodes[ $shortcode ] . '</strong>';120 121 118 // Content with prefix. 122 $content = "{$ prefix} {$content}";119 $content = "{$content}"; 123 120 124 121 // Callout box output. 125 122 $output .= "<div class='callout {$class}'>"; 126 $output .= '<div class="dashicons"></div>'; // Icon holder127 123 $output .= apply_filters( 'the_content', $content ); 128 124 $output .= '</div>'; 129 125 } … … 132 128 } 133 129 134 130 $callouts = new WPorg_Handbook_Callout_Boxes(); 135 -
handbook/stylesheets/callout-boxes.css
1 1 .callout { 2 padding: 15px 40px 15px 46px; 3 margin-bottom: 1.5em; 4 overflow: auto; 5 position: relative; 2 position: relative; 3 overflow: auto; 4 padding: 1em 3em 1em 4em; 5 margin-bottom: 1.5em; 6 border-width: 1px 1px 3px 1px; 7 border-style: solid; 6 8 } 7 .callout .dashicons { 8 position: absolute; 9 font-size: 2em; 10 top: 12px; 11 left: 10px; 9 10 .callout:before { 11 content: ""; 12 position: absolute; 13 font-family: "dashicons"; 14 font-size: 2em; 15 top: auto; 16 left: 0.5em; 12 17 } 13 .callout p { 14 margin-bottom: 0; 18 19 .callout .prefix { 20 display: block; 21 margin-bottom: 0.7em; 22 font-size: 2em; 23 line-height: 1; 24 font-weight: bold; 15 25 } 26 16 27 .callout-info { 17 background: #c8dffa; 18 border: 1px solid #6ba9f1; 19 border-bottom: 3px solid #2480eb; 28 background: #e3f3fc; 29 border-color: #b2cfdf; 20 30 } 21 .callout-info .dashicons:before { 22 content: "\f348"; 23 color: #2480eb; 31 32 .callout-info:before { 33 content: "\f348"; 34 color: #b2cfdf; 24 35 } 36 25 37 .callout-tip { 26 background: #e0f9d0; 27 border: 1px solid #a4ed76; 28 border-bottom: 3px solid #69e01d; 38 background: #f3f9ec; 39 border-color: #cfe8be; 29 40 } 30 .callout-tip .dashicons:before { 31 content: "\f339"; 32 color: #69e01d; 41 42 .callout-tip:before { 43 content: "\f339"; 44 color: #cfe8be; 33 45 } 46 34 47 .callout-alert { 35 background: #fff9c7; 36 border: 1px solid #ffe92e; 37 border-bottom: 3px solid #c7b200; 48 background: #fffbe6; 49 border-color: #e4d48c; 38 50 } 39 .callout-alert .dashicons:before { 40 content: "\f109"; 41 color: #c7b200; 51 52 .callout-alert:before { 53 content: "\f109"; 54 color: #e4d48c; 42 55 } 56 43 57 .callout-warning { 44 background: #ffd8d8; 45 border: 1px solid #ff7272; 46 border-bottom: 3px solid #ff3f3f; 58 background: #ffeeee; 59 border-color: #e1b6b5; 47 60 } 48 .callout-warning .dashicons:before {49 content: "\f153";50 color: #ff3f3f;51 }52 61 62 .callout-warning:before { 63 content: "\f153"; 64 color: #e1b6b5; 65 } 66 No newline at end of file