,zurb-foundation,simple-form,Zurb Foundation,Simple Form" /> ,zurb-foundation,simple-form,Zurb Foundation,Simple Form" />

Zurb foundation 使用Simple形式和基础5的自定义输入 我在SimeLySype中创建了一个自定义输入,我使用的是基础5。 class CurrencyInput < SimpleForm::Inputs::Base def input input_html_classes.unshift("string currency") input_html_options[:type] ||= input_type if html5? "$ #{@builder.text_field(attribute_name, input_html_options)}".html_safe end end class CurrencyInput在基础安装中查看 /BoeRyObjs/Fung/SsS/Fung/Posie/Sype。SCS。< /P>

Zurb foundation 使用Simple形式和基础5的自定义输入 我在SimeLySype中创建了一个自定义输入,我使用的是基础5。 class CurrencyInput < SimpleForm::Inputs::Base def input input_html_classes.unshift("string currency") input_html_options[:type] ||= input_type if html5? "$ #{@builder.text_field(attribute_name, input_html_options)}".html_safe end end class CurrencyInput在基础安装中查看 /BoeRyObjs/Fung/SsS/Fung/Posie/Sype。SCS。< /P>,zurb-foundation,simple-form,Zurb Foundation,Simple Form,创建的输入字段具有默认的浏览器样式。如何将基础文本字段样式应用于该货币字段,使其看起来像所有其他文本字段。我曾尝试使用基金会使用的类名用于其他字段,但它没有任何效果。我还没有找到任何关于如何做到这一点的文档。我怎样才能做到这一点?任何帮助都是值得赞赏的。 < P>在基础安装中查看 /BoeRyObjs/Fung/SsS/Fung/Posie/Sype。SCS。< /P> 从第407行(最新基础)开始,您应该看到: /* We use this to get basic styling on al

创建的输入字段具有默认的浏览器样式。如何将基础文本字段样式应用于该货币字段,使其看起来像所有其他文本字段。我曾尝试使用基金会使用的类名用于其他字段,但它没有任何效果。我还没有找到任何关于如何做到这一点的文档。我怎样才能做到这一点?任何帮助都是值得赞赏的。

< P>在基础安装中查看<代码> /BoeRyObjs/Fung/SsS/Fung/Posie/Sype。SCS。< /P> 从第407行(最新基础)开始,您应该看到:

/* We use this to get basic styling on all basic form elements */
input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="time"],
input[type="url"],
textarea {
  -webkit-appearance: none;
  -webkit-border-radius: 0px;
  @include form-element;
  @if $input-include-glowing-effect == false {
      @include single-transition(all, 0.15s, linear);
  }
  &.radius {
    @include radius($input-border-radius);
  }
}
下面是一些样式,您可以复制到
app.scss
文件中,将
合并到最终的CSS中。例如:

input[type="currency"] {
  -webkit-appearance: none;
  -webkit-border-radius: 0px;
  @include form-element;
  @if $input-include-glowing-effect == false {
      @include single-transition(all, 0.15s, linear);
  }
  &.radius {
    @include radius($input-border-radius);
  }
}
<>你可以简单地将你的类型添加到那些样式中,但是我认为在基金会自己的文件中更改这不是一个好主意,因为它可能会被将来更新到你的本地基金会删除。