Metro 应用程序的默认 CSS 类

发布于 2024-12-09 07:53:00 字数 398 浏览 0 评论 0原文

我一直在寻找构建 Metro 应用程序时使用的默认 CSS 样式表。我读到了一些关于当您创建新的 Metro 风格应用程序时,Blend 的开发预览中包含两个默认 CSS 文件的内容。不幸的是,我没有运行 Win8 开发预览版,目前我也没有地方可以设置它。

那么,如果有人运行预览版也会如此友善吗?据我了解,您只需打开 Blend,创建一个新的 Metro 风格应用程序,两个文件(ui-light.css、ui-dark.css)都包含在模板中。另请参阅 http://www.timmykokke.com/2011/09/discovering-表达式混合样式/

I was looking for a default CSS stylesheet to use when building Metro apps. I read some things about two default CSS files being included in the dev preview of Blend when you create a new Metro style application. Unfortunately, I don't have the Win8 dev preview running and at the moment I don't have a place to set it up either.

So if someone who does have the preview running could be so kind? From what I understand you only have to open up Blend, create a new Metro style app and the two files (ui-light.css, ui-dark.css) are included in the template. Also see http://www.timmykokke.com/2011/09/discovering-expression-blendstyles/.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆夏时光 2024-12-16 07:53:00

我强烈推荐 Windows 8 应用主题颜色(主题滚轮)示例
有了这个,您可以通过配置一堆颜色轻松推出自己的主题,然后它会为您提供一个 CSS 文件,您可以在其中轻松查看默认的 css 类。

虽然这仅提供颜色类,但它是了解 Windows 8 类名称的良好开端。

示例:对于我的 Windows 8 游戏,我想要一个与游戏匹配的橙色主题风格好一点。这是主题滚轮示例的结果,我自己做了一些修改:

/*WinJS custom style overrides - created with http://code.msdn.microsoft.com/windowsapps/Theme-roller-sample-64b679f2
    settings:
    1: 255, 182, 56
    2: 0,0,0
    3: 255, 165, 0
    4: 255,255,255

    removed link color overrides
    */


/*
Text selection color
*/
::selection, select:focus::-ms-value {
    background-color: rgb(255, 165, 0);
    color: rgb(255, 255, 255);
}

/*
Option control color
*/
option:checked {
    background-color: rgb(255, 165, 0);
    color: rgb(255, 255, 255);
}

    option:checked:hover, select:focus option:checked:hover {
        background-color: rgb(255, 177, 33);
        color: rgb(255, 255, 255);
    }

/*
Button control colors.
*/
button[type=submit], input[type=submit] {
    background-color: rgb(255, 165, 0);
    border-color: rgb(255, 165, 0);
    color: rgb(255, 255, 255);
}

    button[type=submit]:hover, input[type=submit]:hover {
        background-color: rgb(255, 177, 33);
        border-color: rgb(255, 177, 33);
    }

/*
Range control colors.
*/
input[type=range]::-ms-fill-lower {
    background-color: rgb(255, 165, 0);
}

input[type=range]:hover::-ms-fill-lower {
    background-color: rgb(255, 177, 33);
}

/*
Progress control colors.
*/
progress, progress:indeterminate {
    color: rgb(255, 165, 0);
}

/*
ListView control colors.
*/
.win-listview .win-container.win-selected:hover {
    background-color: rgb(255, 177, 33);
}

.win-listview .win-selected {
    color: rgb(255, 255, 255);
}

.win-dragoverlay {
    background-color: rgb(255, 165, 0);
}

.win-container.win-selected .win-selectionborder {
    border: 4px solid rgb(255, 165, 0);
}

.win-container.win-selected:hover .win-selectionborder {
    border: 4px solid rgb(255, 177, 33);
}

.win-selected .win-selectionbackground {
    background-color: rgb(255, 165, 0);
}

.win-selected:hover .win-selectionbackground {
    background-color: rgb(255, 177, 33);
}

.win-selectioncheckmark {
    color: rgb(255, 255, 255);
}

.win-selectionhint {
    color: rgb(255, 165, 0);
}

.win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 165, 0);
    border-right: solid 20px rgb(255, 165, 0);
    border-left: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

.win-container.win-selected:hover .win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 177, 33);
    border-right: solid 20px rgb(255, 177, 33);
    border-left: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

.win-rtl .win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 165, 0));
    border-left: solid 20px rgb(255, 165, 0);
    border-right: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

.win-rtl .win-container.win-selected:hover .win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 177, 33);
    border-left: solid 20px rgb(255, 177, 33);
    border-right: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

/*
Command button colors.
*/
button.win-command {
    color: rgb(0, 0, 0);
}

    button.win-command:hover {
        color: rgb(0, 0, 0);
    }

    button.win-command:active {
        color: rgb(0, 0, 0);
    }

    button.win-command:hover:active {
        color: rgb(0, 0, 0);
    }

.win-commandimage {
    color: rgb(0, 0, 0);
}

button:hover:active .win-commandimage {
    color: rgb(256, 182, 56);
}

button[aria-selected=true] .win-commandimage {
    color: rgb(256, 182, 56);
}

button[aria-selected=true]:hover .win-commandimage,
button[aria-selected=true]:active .win-commandimage,
button[aria-selected=true]:hover:active .win-commandimage {
    color: rgb(0, 0, 0);
}

/*
Command ring colors.
*/
.win-commandring {
    background-color: transparent;
    border-color: rgb(0, 0, 0);
    color: rgb(0, 0, 0);
}

button:hover .win-commandring, button:active .win-commandring {
    background-color: rgb(256, 191, 82);
    border-color: rgb(0, 0, 0);
}

button:hover:active .win-commandring {
    background-color: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
}

button[aria-selected=true] .win-commandring {
    background-color: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
}

button[aria-selected=true]:hover .win-commandring,
button[aria-selected=true]:active .win-commandring {
    background-color: transparent;
    border-color: rgb(0, 0, 0);
}

button[aria-selected=true]:hover:active .win-commandring {
    background-color: transparent;
    border-color: rgb(0, 0, 0);
}

/*
AppBar control colors.
*/
.win-appbar {
    background-color: rgb(256, 182, 56);
    border-color: rgb(256, 182, 56);
}

/*
Rating control colors.
*/
.win-rating .win-star.win-user.win-full {
    color: rgb(255, 165, 0);
}

.win-rating .win-star.win-tentative.win-full {
    color: rgb(255, 177, 33);
}

I highly recommend the Windows 8 App Theme color (theme roller) example.
With this you can easily roll your own theme by configuring a bunch of colors and it then gives you a CSS file where you can easily see the default css classes.

While this only gives you color classes it is a good start to understand the Windows 8 class names.

Example: For my Windows 8 game I wanted an orange theme that matches the game style a bit better. This is the result of the theme roller example with some modifications I did myself:

/*WinJS custom style overrides - created with http://code.msdn.microsoft.com/windowsapps/Theme-roller-sample-64b679f2
    settings:
    1: 255, 182, 56
    2: 0,0,0
    3: 255, 165, 0
    4: 255,255,255

    removed link color overrides
    */


/*
Text selection color
*/
::selection, select:focus::-ms-value {
    background-color: rgb(255, 165, 0);
    color: rgb(255, 255, 255);
}

/*
Option control color
*/
option:checked {
    background-color: rgb(255, 165, 0);
    color: rgb(255, 255, 255);
}

    option:checked:hover, select:focus option:checked:hover {
        background-color: rgb(255, 177, 33);
        color: rgb(255, 255, 255);
    }

/*
Button control colors.
*/
button[type=submit], input[type=submit] {
    background-color: rgb(255, 165, 0);
    border-color: rgb(255, 165, 0);
    color: rgb(255, 255, 255);
}

    button[type=submit]:hover, input[type=submit]:hover {
        background-color: rgb(255, 177, 33);
        border-color: rgb(255, 177, 33);
    }

/*
Range control colors.
*/
input[type=range]::-ms-fill-lower {
    background-color: rgb(255, 165, 0);
}

input[type=range]:hover::-ms-fill-lower {
    background-color: rgb(255, 177, 33);
}

/*
Progress control colors.
*/
progress, progress:indeterminate {
    color: rgb(255, 165, 0);
}

/*
ListView control colors.
*/
.win-listview .win-container.win-selected:hover {
    background-color: rgb(255, 177, 33);
}

.win-listview .win-selected {
    color: rgb(255, 255, 255);
}

.win-dragoverlay {
    background-color: rgb(255, 165, 0);
}

.win-container.win-selected .win-selectionborder {
    border: 4px solid rgb(255, 165, 0);
}

.win-container.win-selected:hover .win-selectionborder {
    border: 4px solid rgb(255, 177, 33);
}

.win-selected .win-selectionbackground {
    background-color: rgb(255, 165, 0);
}

.win-selected:hover .win-selectionbackground {
    background-color: rgb(255, 177, 33);
}

.win-selectioncheckmark {
    color: rgb(255, 255, 255);
}

.win-selectionhint {
    color: rgb(255, 165, 0);
}

.win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 165, 0);
    border-right: solid 20px rgb(255, 165, 0);
    border-left: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

.win-container.win-selected:hover .win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 177, 33);
    border-right: solid 20px rgb(255, 177, 33);
    border-left: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

.win-rtl .win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 165, 0));
    border-left: solid 20px rgb(255, 165, 0);
    border-right: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

.win-rtl .win-container.win-selected:hover .win-selectioncheckmarkbackground {
    border-top: solid 20px rgb(255, 177, 33);
    border-left: solid 20px rgb(255, 177, 33);
    border-right: solid 20px transparent;
    border-bottom: solid 20px transparent;
}

/*
Command button colors.
*/
button.win-command {
    color: rgb(0, 0, 0);
}

    button.win-command:hover {
        color: rgb(0, 0, 0);
    }

    button.win-command:active {
        color: rgb(0, 0, 0);
    }

    button.win-command:hover:active {
        color: rgb(0, 0, 0);
    }

.win-commandimage {
    color: rgb(0, 0, 0);
}

button:hover:active .win-commandimage {
    color: rgb(256, 182, 56);
}

button[aria-selected=true] .win-commandimage {
    color: rgb(256, 182, 56);
}

button[aria-selected=true]:hover .win-commandimage,
button[aria-selected=true]:active .win-commandimage,
button[aria-selected=true]:hover:active .win-commandimage {
    color: rgb(0, 0, 0);
}

/*
Command ring colors.
*/
.win-commandring {
    background-color: transparent;
    border-color: rgb(0, 0, 0);
    color: rgb(0, 0, 0);
}

button:hover .win-commandring, button:active .win-commandring {
    background-color: rgb(256, 191, 82);
    border-color: rgb(0, 0, 0);
}

button:hover:active .win-commandring {
    background-color: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
}

button[aria-selected=true] .win-commandring {
    background-color: rgb(0, 0, 0);
    border-color: rgb(0, 0, 0);
}

button[aria-selected=true]:hover .win-commandring,
button[aria-selected=true]:active .win-commandring {
    background-color: transparent;
    border-color: rgb(0, 0, 0);
}

button[aria-selected=true]:hover:active .win-commandring {
    background-color: transparent;
    border-color: rgb(0, 0, 0);
}

/*
AppBar control colors.
*/
.win-appbar {
    background-color: rgb(256, 182, 56);
    border-color: rgb(256, 182, 56);
}

/*
Rating control colors.
*/
.win-rating .win-star.win-user.win-full {
    color: rgb(255, 165, 0);
}

.win-rating .win-star.win-tentative.win-full {
    color: rgb(255, 177, 33);
}
向日葵 2024-12-16 07:53:00

对于开发人员预览版,您可以在示例库中在线浏览 CSS:http://code.msdn.microsoft.com/windowsapps/Fragments-91f66b07/sourcecode?fileId=43749&pathId=934384843

但是,您应该下载最新的 Windows 8 消费者预览版和最新的 Visual Studio 测试版。

For the developer preview release you could browse the CSS online in the sample gallery: http://code.msdn.microsoft.com/windowsapps/Fragments-91f66b07/sourcecode?fileId=43749&pathId=934384843.

However, you should download the latest Windows 8 consumer preview, and Visual Studio beta for the latest.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文