粘性顶栏过渡问题

时间:2017-08-28 12:39:09

标签: css-transitions sticky zurb-foundation-6

我使用Foundation 6创建了一个粘性标题,但它不接受过渡,因此很不好。顶栏看起来很生涩。任何人都可以帮忙,让我知道问题所在。我不确定以下缺少什么。以下是我的代码:

$topbar-sticky-shrink-padding: 1rem 0; // controls the un-stuck height of topbar
$topbar-sticky-shrink-padding-stuck: 0; // controls the is stuck height of topbar
$topbar-sticky-shrink-bg: #2c3840;

.sticky {
    background-color: $white;
}

.topbar-sticky-shrink {
  padding:$topbar-sticky-shrink-padding;
  transition: padding 0.25s ease;

  .menu {
  }
}

.is-stuck .topbar-sticky-shrink {
  padding: $topbar-sticky-shrink-padding-stuck;
  transition: padding 0.25s ease;
}

我的Sass文件包含以下内容:

InputComponent

1 个答案:

答案 0 :(得分:0)

修复方法是为$topbar-sticky-shrink-paddin g和$topbar-sticky-shrink-padding-stuck提供相同的填充。