2
A
回答
1
我也想自定義窗口小部件,並結束了與此:
由於沒有主題支持我決定把下面的代碼後select2.css
/* _select2-custom.scss */
/* Applies to container when is shown above and below */
.select2-container,
.select2-dropdown-open.select2-drop-above {
width: auto !important;
/* Button */
> a.select2-choice
/* require bootstrap-sass */
@extend .btn;
line-height: 26px;
padding:0 4px 0 4px;
/* Button Text */
.select2-chosen{
width:100%;
padding-left: 12px;
padding-right: 12px;
margin-right: 12px;
text-align: left;
color:$gray;
/* Text Without Selection */
&.select2-default{
color:$grayLighter;
}
}
/* Button arrow */
.select2-arrow{
border-color:#BBB;
background:none;
}
}
}
/* When button is :hover or :active */
.select2-container-active {
> a.select2-choices,
> a.select2-choice{
border-color: rgba(168, 168, 168, 0.8);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(168, 168, 168, 0.6);
transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
}
}
/* Delete Button */
.select2-container.select2-allowclear .select2-choice .select2-chosen{
margin-right: 24px;
}
/* Selection */
.select2-drop,
.select2-drop.select2-drop-above,
.select2-drop-active {
border: 1px solid $selectBorder;
border-radius: 2px;
margin-top:4px;
margin-bottom:4px;
/* */
min-width: 180px !important;
}
.select2-results{
li + li { border-top:1px solid $selectHeader; }
.select2-no-results{
color:$grayLight;
background-color: transparent;
}
.extra{
display:block;
}
}
.select2-search{
background-color: $selectHeader;
padding-left: 6px;
padding-right: 6px;
padding-top: 10px;
/* Search input field */
input[type=text],
input[type=text]:focus{
box-shadow:none;
border-color: $selectBorder;
}
}
有有些事情要記住:
- 全部選擇器必須具有相同或更高的特異性。
- 寬度爲
.select-drop
,也許其他規則必須包含要應用的!important修飾符,因爲它們由插件內聯設置。
相關問題
- 1. Knockout.js通過PARAMS自定義組件
- 2. 如何自定義jquery select2插件 - 選擇框的jQuery替換
- 3. 如何通過CSS自定義滾動?
- 4. jQuery Select2 TypeError:b未定義
- 5. Select2 +自定義滾動條
- 6. jQuery Select2 CSS問題
- 7. 通過cookie的jQuery自定義背景
- 8. 通過jquery訪問自定義屬性
- 9. SELECT2 AJAX不選擇結果 - Ember.js Ember Cli自定義組件
- 10. jQuery UI datepicker css自定義
- 11. NativeScript 2.0自定義組件和CSS
- 12. Joomla!自定義組件css問題
- 13. SQL組通過自定義範圍?
- 14. 組通過自定義時間段
- 15. 通過組件添加自定義UI行爲到控件
- 16. 布爾瑪CSS與select2的jQuery插件
- 17. MATLAB通過自定義條件排序
- 18. C#通過自定義UI設置SSIS自定義數據流組件的自定義屬性
- 19. C#通過自定義UI設置SSIS自定義數據流組件的自定義連接
- 20. 如何通過自定義控件添加css時停止Visual Studio css intellisense
- 21. 通過時尚的CSS從本地文件加載自定義CSS?
- 22. jquery通過自定義事件的對話框傳遞數據
- 23. JQuery - 通過自定義事件上的動態元素循環
- 24. Laravel:自定義CSS文件
- 25. Nginx自定義css文件
- 26. 通過UIActionSheet自定義UIView
- 27. 通過自定義字段
- 28. 通過VBScript自定義Excel
- 29. 通過android自定義CheckBoxPreference:widgetLayout
- 30. 通過自定義列