> */ public static function get_chunks() { $positions = self::get_positions_chunks(); return [ 'base' => self::get_base(), 'button' => Button::get_global_injector_css(), 'icon' => Icon::get_global_injector_css(), 'cover' => Cover::get_global_injector_css(), 'shared' => self::get_shared(), 'positions' => $positions, 'print' => self::get_print(), ]; } /** * Base layout and copy button reset (unminified). * * @return string */ private static function get_base() { return '/* CTC Global Injector */ .ctc-wrapper { position: relative; } .ctc-copy-btn { display: inline-flex; align-items: center; gap: 6px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-weight: var(--ctc-font-weight, 500); line-height: 1.4; cursor: pointer; border: none; outline: none; transition: all 0.15s ease; } .ctc-copy-btn:focus { outline: 2px solid var(--ctc-bg, #4f46e5); outline-offset: 2px; } .ctc-copy-btn:active { transform: scale(0.97); } '; } /** * Shared (button + icon) states and icon/copied (unminified). * * @return string */ private static function get_shared() { return ' .ctc-copy-btn__icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; } .ctc-copy-btn__icon svg { display: block; fill: transparent; width: 14px; height: 14px; } .ctc-copy-btn--copied svg { fill: currentColor; } .ctc-copy-btn__text { white-space: nowrap; } .ctc-copy-btn--copied { animation: ctc-pulse 0.3s ease; } .ctc-copy-btn--error { opacity: 0.7; } @keyframes ctc-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } } '; } /** * Position chunks: inside_* and outside (unminified). * * @return array */ private static function get_positions_chunks() { $all_inside = [ 'inside_top_left', 'inside_top_right', 'inside_bottom_left', 'inside_bottom_right' ]; $positions = []; foreach ( $all_inside as $p ) { $sel = '.ctc-wrapper--' . $p . ' .ctc-copy-btn--button,.ctc-wrapper--' . $p . ' .ctc-copy-btn--icon'; $parts = explode( '_', str_replace( 'inside_', '', $p ), 2 ); $vert = $parts[0] ?? 'top'; $horz = $parts[1] ?? 'right'; $top = ( $vert === 'top' ) ? '8px' : 'auto'; $bottom = ( $vert === 'bottom' ) ? '8px' : 'auto'; $left = ( $horz === 'left' ) ? '8px' : 'auto'; $right = ( $horz === 'right' ) ? '8px' : 'auto'; $positions[ $p ] = $sel . ' { position: absolute; top: ' . $top . '; right: ' . $right . '; bottom: ' . $bottom . '; left: ' . $left . '; } '; } $positions['outside'] = ' .ctc-outside { display: flex; margin: 4px 0; } .ctc-outside--outside_before_left, .ctc-outside--outside_after_left { justify-content: flex-start; } .ctc-outside--outside_before_right, .ctc-outside--outside_after_right { justify-content: flex-end; } .ctc-wrapper--outside_before_left .ctc-copy-btn, .ctc-wrapper--outside_before_right .ctc-copy-btn, .ctc-wrapper--outside_after_left .ctc-copy-btn, .ctc-wrapper--outside_after_right .ctc-copy-btn { position: relative; top: auto; right: auto; bottom: auto; left: auto; } '; return $positions; } /** * Print hide (unminified). * * @return string */ private static function get_print() { return ' @media print { .ctc-copy-btn, .ctc-cover-overlay { display: none !important; } } '; } }