public string GetStylesTag()
        {
            var sb = new StringBuilder();

            sb.AppendLine($"<style type=\"text/css\" scoped>");

            ThemeGenerator.GenerateStyles(sb, Theme);

            sb.AppendLine("</style>");

            return(sb.ToString());
        }
        public string GetVariablesTag()
        {
            var sb = new StringBuilder();

            sb.AppendLine("<style>");
            sb.AppendLine(":root");
            sb.AppendLine("{");

            ThemeGenerator.GenerateVariables(sb, Theme);

            sb.AppendLine("}");
            sb.AppendLine("</style>");

            return(sb.ToString());
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the html tag that will be inserted into the DOM and that will contain the styles.
        /// </summary>
        /// <returns>HTML variables tag element content.</returns>
        public string GetStylesTag()
        {
            if (!theme?.Enabled == true)
            {
                return(null);
            }

            var sb = new StringBuilder();

            sb.AppendLine("<style type=\"text/css\" scoped>");

            sb.AppendLine(ThemeGenerator.GenerateStyles(Theme));

            sb.AppendLine("</style>");

            return(sb.ToString());
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Gets the html tag that will be inserted into the DOM and that will contain the variables.
        /// </summary>
        /// <returns>HTML variables tag element content.</returns>
        public string GetVariablesTag()
        {
            if (!theme?.Enabled == true)
            {
                return(null);
            }

            var sb = new StringBuilder();

            sb.AppendLine("<style>");
            sb.AppendLine(":root");
            sb.AppendLine("{");

            sb.AppendLine(ThemeGenerator.GenerateVariables(Theme));

            sb.AppendLine("}");
            sb.AppendLine("</style>");

            return(sb.ToString());
        }