2

是否有更改 JuiceUI 控件样式的选项?任何预定义的主题?(如果是,我找不到任何关于它的文档。)我是否像其他控件一样使用常规 CSS 设置它们的样式?(这似乎也不起作用。)

TIA

编辑:这是按钮的外观:(我没有预装 jquery 主题 - 这是一个新网站。)

在此处输入图像描述
我确实注意到 JuiceUI 安装了一个内容 - 主题文件夹,其中包含基础、Fresh-Squeezed 和 Supercharged。

不知道它在哪里被引用以及如何更改它。

4

4 回答 4

9

目前,JuiceUI 的源代码可以成为你最好的朋友。查看这一行:https ://github.com/appendto/juiceui/blob/master/Juice/JuiceApp.cs#L52

这是您要添加到 Global.asax.cs 的内容:

CssManager.CssResourceMapping.AddDefinition("juice-ui", new CssResourceDefinition {
    Path = "~/Content/themes/[Name of custom theme dir]/jquery-ui-1.8.18.custom.css",
    DebugPath = "~/Content/themes/[Name of custom theme dir]/jquery-ui-1.8.18.custom.css"
});

这将重新定义“juice-ui”渲染主题的位置,您将看到每个页面中的输出都使用了果汁。

抱歉,目前这一点并不明显。我们计划撰写一系列文章来涵盖这些主题,并且更新网站上的文档已经在进行中。

于 2012-04-27T13:22:22.903 回答
4

对于 VB... 是的,人们仍在使用它!:P

<%@ Application Language="VB" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="Juice.Framework" %>

<script runat="server">

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Code that runs on application startup

        Dim juiResDef As New CssResourceDefinition
        juiResDef.Path = "~/Content/themes/[Name of custom theme dir]/jquery-ui-1.8.18.custom.css"
        juiResDef.DebugPath = "~/Content/themes/[Name of custom theme dir]/jquery-ui-1.8.18.custom.css"
        CssManager.CssResourceMapping.AddDefinition("juice-ui", juiResDef)

    End Sub

</script>

好走:)

于 2012-04-28T03:24:31.533 回答
1

另一种覆盖 Fresh-Squeezed 默认值的方法是将 jquery-ui-XXXX.custom.css 文件拖放到页面上并创建指向它的 html 链接。这将覆盖默认的 css 并应用您想要的主题。它必须在您想要使用主题的任何页面上完成。另一种方法是将 Fresh-Squeezed 文件夹视为您要使用的主题的容器,并替换该文件夹中的图像和 custom.css 文件。希望他们会在未来的版本中提供一种不同的修改方式。

于 2012-05-11T17:49:33.573 回答
0

贝基,在查看了 GitHub 存储库后,它似乎正在使用 ui-lightness css 文件用于 jQuery UI。https://github.com/appendto/juiceui/tree/master/Juice-Test-Site/css您可以尝试加载不同的 jQuery 主题来代替它吗?您可能必须确保此文件未加载到您的站点上。如果我离基地很远,而你已经尝试过,请告诉我。

于 2012-04-26T22:30:49.107 回答