1 module uim.bootstrap.bs4.components.navbars.navbar; 2 3 import uim.bootstrap; 4 5 class DBS4Navbar : DBS4Obj { 6 mixin(H5This!("Nav", ["navbar"])); 7 8 O center(this O)(bool value = true) { 9 if (value) this.classes("justify-content-center"); 10 return cast(O)this; 11 } 12 unittest { 13 assert(Assert(BS4Navbar.center, `<nav class="justify-content-center navbar"></nav>`)); 14 assert(Assert(BS4Navbar("Test").center, `<nav class="justify-content-center navbar">Test</nav>`)); 15 } 16 17 O dark(this O)(bool value = true) { 18 if (value) this.classes("navbar-dark"); 19 return cast(O)this; 20 } 21 unittest { 22 assert(Assert(BS4Navbar.dark, `<nav class="navbar navbar-dark"></nav>`)); 23 } 24 25 O expand(this O)(string screenSize) { 26 this.classes("navbar-expand-" ~ screenSize); 27 return cast(O)this; 28 } 29 /// 30 unittest { 31 assert(Assert(BS4Navbar.expand("lg"), `<nav class="navbar navbar-expand-lg"></nav>`)); 32 } 33 34 O light(this O)(bool value = true) { 35 this.classes("navbar-light"); 36 return cast(O)this; 37 } 38 /// 39 unittest { 40 assert(Assert(BS4Navbar.light, `<nav class="navbar navbar-light"></nav>`)); 41 } 42 43 /* 44 mixin(MyContent!("nav", "DBS4NavbarNav")); 45 /// 46 unittest 47 { 48 assert(Assert(BS4Navbar.nav, `<nav class="navbar"><ul class="navbar-nav"></ul></nav>`); 49 }*/ 50 } 51 52 mixin(H5Calls!"BS4Navbar"); 53 /// 54 unittest 55 { 56 assert(Assert(BS4Navbar, `<nav class="navbar"></nav>`)); 57 }