如何更改 Twitter 的 Bootstrap CSS 的颜色?

发布于 2024-11-30 23:52:35 字数 230 浏览 10 评论 0原文

今天之前我没少用过。

我将 preboot.less 中的颜色更改为:

// Color Scheme
@baseColor:         @orange;                  // Set a base color

然后编译了 less 文件。一切都出来了,但一切仍然是蓝色的。

所以我尝试了 js.less 路线。还是蓝色。

I've not used less before today.

I changed the colour in preboot.less to:

// Color Scheme
@baseColor:         @orange;                  // Set a base color

I then complied the less files. It all came out, but everything was still blue.

So I tried the js.less route. Still blue.

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

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

发布评论

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

评论(6

尹雨沫 2024-12-07 23:52:35

这是一个根据图片工作的引导主题生成器......因此,您只需拍摄“旧”网站的照片,将其上传到此处,它就会生成与您的旧配色方案相匹配的主题!

注意:该网站目前似乎处于离线状态。如果您仍然需要此功能,您可以从其 Github 存储库安装该网站,然后从那里尝试。

http://www.lavishbootstrap.com/

当然 Bootstrap 本身允许您自定义现在下载时的颜色,但这涉及大量的配色方案剪切和粘贴...上面的工具可以为您解决所有问题...

http ://getbootstrap.com/customize/

Here's a bootstrap theme generator that works from a picture.... So you can just take a picture of your "old" website, upload it here, and it'll generate a theme that matches your old color scheme!

Note: This site appears to be offline at the moment. If you still want this feature, you can install the site from it's Github repo, and try it from there.

http://www.lavishbootstrap.com/

and of course Bootstrap itself allows you to customize the colors when you download it now, but that involves lots of cutting and pasting of color schemes.... The tool above figures it all out for you...

http://getbootstrap.com/customize/

战皆罪 2024-12-07 23:52:35

您可能会发现 Bootstrap Generator 很有用 - 它可以让您选择颜色等并生成编译后的文件为您提供 Boostrap CSS 文件。

You might find the Bootstrap Generator useful - it lets you choose colours etc and generates a compiled Boostrap CSS file for you.

心是晴朗的。 2024-12-07 23:52:35

如果您使用 2.0-wip 版本,这就是交易。

.primary 类使用 @blue 和 @blueDark 变量来创建按钮的渐变。这些变量在variables.less 文件中设置。

在 Buttons.less 文件中,其他按钮类均使用十六进制值进行硬编码。

// Danger and error appear as red
  &.danger {
    .gradientBar(#ee5f5b, #c43c35);
  }
  // Success appears as green
  &.success {
    .gradientBar(#62c462, #57a957);
  }
  // Info appears as a neutral blue
  &.info {
    .gradientBar(#5bc0de, #339bb9);
  }

您必须更改这些十六进制值或创建用于替换十六进制值的变量。我自己刚开始使用 Twitter 的引导程序,但这似乎是情况。

If you are using 2.0-wip version, this is the deal.

the .primary class uses the @blue and @blueDark variables for creating the button's gradient. Those variables are set in the variables.less file.

In the buttons.less file, the other button classes are hard-coded with hex values.

// Danger and error appear as red
  &.danger {
    .gradientBar(#ee5f5b, #c43c35);
  }
  // Success appears as green
  &.success {
    .gradientBar(#62c462, #57a957);
  }
  // Info appears as a neutral blue
  &.info {
    .gradientBar(#5bc0de, #339bb9);
  }

You have to change those hex values or create variables that you replace the hex values with. I'm new to using bootstrap from twitter myself, but this appears to be the situation.

ˉ厌 2024-12-07 23:52:35

您是否将 @orange 变量设置为颜色,例如

@orange: #FF2400;

Have you set the @orange variable to a color, like this

@orange: #FF2400;

花落人断肠 2024-12-07 23:52:35

这是 #01a4d9 颜色 btn

.btn {
    border-color:#c5c5c5;
    border-color:rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
 }

.btn-primary {
    color:#ffffff;
    text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
    background-color:#007cc5;
    background-image:-moz-linear-gradient(top, #01a4d9, #0193c5);
    background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#01a4d9),  to(#0193c5));
    background-image:-webkit-linear-gradient(top, #01a4d9, #0193c5);
    background-image:-o-linear-gradient(top, #01a4d9, #0193c5);
    background-image:linear-gradient(to bottom, #01a4d9, #0193c5);
    background-repeat:repeat-x;
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0096c5', endColorstr='#ff0054c5', GradientType=0);
    border-color:#0193c5 #0193c5 #003479;
    border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
    *background-color:#0193c5;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);
 }

.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled] {
    color:#ffffff;
    background-color:#0193c5;
    *background-color:#0049ac;
 }

.btn-primary:active,.btn-primary.active {
    background-color:#003f92 \9;
 }

This one for the #01a4d9 color btn

.btn {
    border-color:#c5c5c5;
    border-color:rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.15) rgba(0, 0, 0, 0.25);
 }

.btn-primary {
    color:#ffffff;
    text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);
    background-color:#007cc5;
    background-image:-moz-linear-gradient(top, #01a4d9, #0193c5);
    background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#01a4d9),  to(#0193c5));
    background-image:-webkit-linear-gradient(top, #01a4d9, #0193c5);
    background-image:-o-linear-gradient(top, #01a4d9, #0193c5);
    background-image:linear-gradient(to bottom, #01a4d9, #0193c5);
    background-repeat:repeat-x;
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0096c5', endColorstr='#ff0054c5', GradientType=0);
    border-color:#0193c5 #0193c5 #003479;
    border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
    *background-color:#0193c5;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);
 }

.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled] {
    color:#ffffff;
    background-color:#0193c5;
    *background-color:#0049ac;
 }

.btn-primary:active,.btn-primary.active {
    background-color:#003f92 \9;
 }
指尖上的星空 2024-12-07 23:52:35

要自定义链接和 .btn-primary 的颜色(我认为问题所指的就是这个),请调整 @linkColor:

@linkColor: @orange;

To customize the color of your links and .btn-primary (which is what I think the question was referring to), adjust the @linkColor:

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