html - 为什么 Jekyll 加载 navbar.less?

标签 html css twitter-bootstrap jekyll github-pages

我正在使用 Jekyll 在本地和 on Github pages 生成一个站点.这两个实例都加载了一个 navbar.less 文件(这会影响我的导航栏),但我在我的代码中找不到。

这个 navbar.less 文件是如何加载的?

这是我的 head.html 文件:

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
  <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}">

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" type="text/css" />
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css">
  <link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
  <link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" type="text/css">
  <link rel="stylesheet" href="{{ "/css/style.css" | prepend: site.baseurl }}">
  <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}">
  <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
</head>

我的 style.css file没有提及这一点。加载它的可能是 Bootstrap 还是 Jekyll?

最佳答案

您看到的是 chrome/firefox 对 map file 的解释由较少的转化产生。你可以在你的最后看到对它的引用bootstrap css file .此文件用于 debugging preprocessor code like less or sass with chrome .

事实上,您的 css 规则在 bootstrap.min.css 文件中。

您只需在 css/style.css 中通过替换来覆盖它:

.navbar .navbar-header .navbar-brand img {
    max-height: 43px;
    margin-top: -14px;
}

作者:

.navbar .navbar-header .navbar-brand img {
    max-height: 43px;
    margin-top: -14px;
    display: inline;
}

关于html - 为什么 Jekyll 加载 navbar.less?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34713816/

相关文章:

css - Twitter Bootstrap float 响应容器

css - 强制绝对 div 听 parent 的填充?

html - 单元格间距和 ConvertTo-Html 片段

css - 当子元素需要比父元素宽时覆盖 Bootstrap 容器宽度

html - 如何在不在 vba 中创建 Internet Explorer 对象的情况下解析 html?

javascript - CSS Accordion 问题与 JavaScript

python - 使用 Bootstrap 和 Django

html - 如何在没有空间的 Bootstrap 文本框和标签中设计

html - 如何将内联 css 添加到 rails link_to helper

html - 将带有背景图像的菜单栏的子项放在 HTML 中的背景图像下方