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()); }
/// <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()); }