1

railsとtwitter-bootstrap-railsの最新のものを使用していますが、プレースホルダーテキストを表示するための入力を取得できません。以下を追加すると:

@placeholderText: @grayLight

bootstrap_and_overrides.css.lessにLess::Errorが表示されます誰かが私に何が欠けているか教えてもらえますか?

Syntax Error on line 30
  (in /home/ubuntu/new-project/app/assets/stylesheets/bootstrap_and_overrides.css.less)

更新** xnmのおかげでエラーはなくなりましたが、プレースホルダーテキストがまだありません。これが私の

@import "twitter/bootstrap/bootstrap";
body { padding-top: 60px; }

@import "twitter/bootstrap/responsive";

// Set the correct sprite paths
@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png');
@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png');

// Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines)
@fontAwesomeEotPath: asset-path('fontawesome-webfont.eot');
@fontAwesomeWoffPath: asset-path('fontawesome-webfont.woff');
@fontAwesomeTtfPath: asset-path('fontawesome-webfont.ttf');
@fontAwesomeSvgzPath: asset-path('fontawesome-webfont.svgz');
@fontAwesomeSvgPath: asset-path('fontawesome-webfont.svg');

// Font Awesome
@import "fontawesome";

// Your custom LESS stylesheets goes here
//
// Since bootstrap was imported above you have access to its mixins which
// you may use and inherit here
//
// If you'd like to override bootstrap's own variables, you can do so here as well
// See http://twitter.github.com/bootstrap/less.html for their names and documentation
//
// Example:
@linkColor: #ff0000;
@placeholderText: @grayLight;

そしてここに私のhtmlがあります:

<div class="placeholding-input">
  <input type="text" class="text-input" autocomplete="off" name="user[name]" maxlength="20">
  <span class="placeholder">Full name</span>
</div>

生成されたスタイルシートは、プレースホルダースタイルを提供しません。何かを@importすることになっていると思いますが、情報が見つかりません。

4

3 に答える 3

2

sassとは異なり、lessは各行の終わりにセミコロンを使用します。

@placeholderText: @grayLight;
于 2012-05-25T07:53:27.927 に答える
1

見つけた。どうやら正しい方法は次のとおりです。

<input type="text" class="text-input" name="user[name]" maxlength="20" placeholder="Full name">

ツイッターのホームページから間違った方法をコピーしたので、非常に混乱しています。

于 2012-05-26T01:31:09.537 に答える
0

これに関する更新でこの問題を参照してください。 https://github.com/seyhunak/twitter-bootstrap-rails/issues/239

于 2012-06-18T07:39:14.810 に答える