<?php
/**
 * @package         Tassos Code Snippets
 * @version         1.0.1-RC2 Free
 *
 * @author          Tassos Marinos <info@tassos.gr>
 * @link            https://www.tassos.gr
 * @copyright       Copyright © 2026 Tassos Marinos All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
 */

namespace Tassos\CodeSnippets\Administrator\Snippet;

/**
 * CSS Snippet
 * 
 * Returns raw CSS code. The Location class handles
 * how to inject it (inline style or WebAsset).
 */
class CssSnippet extends Snippet
{
    /**
     * Display color used for the snippet (hex).
     *
     * @var string
     */
    protected $color = '#2062b0';

    /**
     * Run the snippet - returns raw CSS code
     *
     * @return string|null The CSS code or null if empty
     */
    public function run()
    {
        $code = $this->snippet->code ?? '';
        return empty(trim($code)) ? null : $code;
    }
}