vardır bir sen kullanabilirsiniz Bootstrap gelen less.js ve Mixins içinde yerleşik işlev bazı:
Bunlar hem neden:
Bu less.js fonksiyonudur
.test {
background: rgba(245, 126, 32, 0.5);
}
.test2 {
background: rgba(245, 126, 32, 0.5);
}
Veya bir önyükleme mixin kullanın:
.test3 {
#translucent > .background(#f57e20, 0.5); // use HSLA mixin
}
sonuçlanır
:
.test3 {
background-color: rgba(244, 123, 31, 0.5);
}
Ben olacak (son ben kontrol) artık Bootstrap 3.0.0 itibariyle dahil edildiğinden, arşivleme amacıyla buraya translucent
Mixins için (sabit) kodu içerir:
// Add an alphatransparency value to any background or border color (via Elyse Holladay)
#translucent {
.background(@color: @white, @alpha: 1) {
background-color: fade(@color, @alpha);
}
.border(@color: @white, @alpha: 1) {
border-color: fade(@color, @alpha);
.background-clip(padding-box);
}
}
denemek isteyebilirsiniz
Karıştırmadan oldukça iyi çalışır! Önyükleme 3.3. – Corni