File tree Expand file tree Collapse file tree 11 files changed +150
-16
lines changed
projects/igniteui-angular/src/lib/core/styles Expand file tree Collapse file tree 11 files changed +150
-16
lines changed Original file line number Diff line number Diff line change 910910 }
911911 }
912912
913- %form-group-label--float {
914- --floating-label-position : -73% ;
915- transform : translateY (var (--floating-label-position ));
916- font-size : rem (12px );
913+ @if $variant == ' material' {
914+ %form-group-label--float {
915+ --floating-label-position : -73% ;
916+
917+ @include type-style (' caption' );
918+
919+ transform : translateY (var (--floating-label-position ));
920+ }
917921 }
918922
919923 %form-group-label--focused-border ,
972976
973977 %form-group-label--float-border {
974978 --label-position : #{sizable (18px , 22px , 26px )} ;
979+
975980 transform : translateY (calc (var (--label-position ) * -1 ));
976- font-size : rem (12px );
977981 margin-top : 0 ;
978982 overflow : hidden ;
979983 will-change : font-size , color , transform ;
17181722 // Label
17191723 %fluent-label {
17201724 display : block ;
1721- font-size : rem (14px );
1722- font-weight : 600 ;
17231725 position : static ;
17241726 transform : translateY (0 );
17251727 transform-origin : top left ;
19391941 display : block ;
19401942 color : var-get ($theme , ' idle-secondary-color' );
19411943 padding : 0 ;
1942- line-height : rem (24px );
19431944 transform : translateY (0 );
19441945 transform-origin : top left ;
19451946 margin-block-start : 0 !important ;
19461947 margin-block-end : rem (4px );
19471948 height : auto ;
1948- font-size : rem (16px );
19491949
19501950 [dir = ' rtl' ] & {
19511951 transform-origin : top right ;
Original file line number Diff line number Diff line change 5050 color : var-get ($theme , ' color' );
5151 max-width : 100% ;
5252 line-height : normal ;
53- font-size : rem (16px );
5453
5554 [dir = ' rtl' ] & {
5655 transform-origin : top right ;
5756 }
5857
59- @if $variant == ' fluent' or $variant == ' indigo-design' {
60- font-size : rem (14px );
61- font-weight : 600 ;
58+ @if $variant != ' material' {
6259 height : auto ;
6360 }
61+ }
62+ }
6463
65- @if $variant == ' bootstrap' {
66- line-height : rem (24px );
67- height : auto ;
64+ /// Adds typography styles for the igx-label component.
65+ /// Uses the 'caption'
66+ /// category from the typographic scale.
67+ /// @group typography
68+ /// @param {Map} $categories [(label: 'caption')] - The categories from the typographic scale used for type styles.
69+ @mixin label-typography (
70+ $categories : (
71+ label : ' subtitle-1' ,
72+ )
73+ ) {
74+ $label : map .get ($categories , ' label' );
75+
76+ %label-base {
77+ @include type-style ($label ) {
78+ margin : 0 ;
6879 }
6980 }
7081}
82+
Original file line number Diff line number Diff line change 3030@use ' ../components/toast/toast-theme' as * ;
3131@use ' ../components/tooltip/tooltip-theme' as * ;
3232@use ' ../components/tree/tree-theme' as * ;
33+ @use ' ../components/label/label-theme' as * ;
3334
3435@mixin typography ($type-scale ) {
3536 @include badge-typography ();
108109 @include toast-typography ();
109110 @include tooltip-typography ();
110111 @include tree-typography ();
112+ @include label-typography ($categories : (
113+ label : ' body-1'
114+ ));
111115}
Original file line number Diff line number Diff line change 2929@use ' ../components/toast/toast-theme' as * ;
3030@use ' ../components/tooltip/tooltip-theme' as * ;
3131@use ' ../components/tree/tree-theme' as * ;
32+ @use ' ../components/label/label-theme' as * ;
3233
3334@mixin typography () {
3435 @include badge-typography ();
104105 ));
105106 @include tooltip-typography ();
106107 @include tree-typography ();
108+ @include label-typography ($categories : (
109+ label : ' subtitle-2'
110+ ));
107111}
Original file line number Diff line number Diff line change 2929@use ' ../components/toast/toast-theme' as * ;
3030@use ' ../components/tooltip/tooltip-theme' as * ;
3131@use ' ../components/tree/tree-theme' as * ;
32+ @use ' ../components/label/label-theme' as * ;
3233
3334@mixin typography () {
3435 @include badge-typography ($categories : (
109110 @include toast-typography ();
110111 @include tooltip-typography ();
111112 @include tree-typography ();
113+ @include label-typography ($categories : (
114+ label : ' caption'
115+ ));
112116}
Original file line number Diff line number Diff line change 2929@use ' ../components/toast/toast-theme' as * ;
3030@use ' ../components/tooltip/tooltip-theme' as * ;
3131@use ' ../components/tree/tree-theme' as * ;
32+ @use ' ../components/label/label-theme' as * ;
3233
3334@mixin typography () {
3435 @include badge-typography ();
6263 @include toast-typography ();
6364 @include tooltip-typography ();
6465 @include tree-typography ();
66+ @include label-typography ();
6567}
Original file line number Diff line number Diff line change @@ -656,6 +656,11 @@ export class AppComponent implements OnInit {
656656 link : '/virtualForDirective' ,
657657 icon : 'view_column' ,
658658 name : 'Virtual-For Directive'
659+ } ,
660+ {
661+ link : '/labelDirective' ,
662+ icon : 'label' ,
663+ name : 'Label Directive'
659664 }
660665 ] . sort ( ( componentLink1 , componentLink2 ) => componentLink1 . name > componentLink2 . name ? 1 : - 1 ) ;
661666
Original file line number Diff line number Diff line change @@ -138,6 +138,7 @@ import { GridValidationSampleComponent } from './grid-validation/grid-validation
138138import { GridExportComponent } from './grid-export/grid-export.sample' ;
139139import { DividerComponent } from './divider/divider.component' ;
140140import { MonthPickerSampleComponent } from './month-picker/month-picker.sample' ;
141+ import { LabelSampleComponent } from "./label/label.sample" ;
141142
142143export const appRoutes : Routes = [
143144 {
@@ -664,5 +665,9 @@ export const appRoutes: Routes = [
664665 {
665666 path : 'stepper' ,
666667 component : StepperSampleComponent
668+ } ,
669+ {
670+ path : 'labelDirective' ,
671+ component : LabelSampleComponent
667672 }
668673] ;
Original file line number Diff line number Diff line change 1+ < div class ="form-container ">
2+ < span > Igx Label on native form elements</ span >
3+
4+ < form >
5+ < div >
6+ < label for ="text_field " igxLabel > Input</ label >
7+ < input id ="text_field " type ="text ">
8+ </ div >
9+
10+ < section >
11+ < input id ="check_box " type ="checkbox ">
12+ < label for ="check_box " igxLabel > Checkbox</ label >
13+ </ section >
14+
15+ < div >
16+ < div >
17+ < input id ="one " type ="radio " name ="count " checked >
18+ < label for ="one " igxLabel > Radio one</ label >
19+ </ div >
20+
21+ < div >
22+ < input id ="two " type ="radio " name ="count ">
23+ < label for ="two " igxLabel > Radio two</ label >
24+ </ div >
25+
26+ < div >
27+ < input id ="three " type ="radio " name ="count ">
28+ < label for ="three " igxLabel > Radio three</ label >
29+ </ div >
30+ </ div >
31+
32+ < div >
33+ < label for ="range " igxLabel > Range picker</ label >
34+ < input id ="range " type ="range ">
35+ </ div >
36+
37+ < div >
38+ < label for ="color " igxLabel > Color picker</ label >
39+ < input id ="color " type ="color ">
40+ </ div >
41+ </ form >
42+ </ div >
Original file line number Diff line number Diff line change 1+ %f-column {
2+ display : flex ;
3+ flex-direction : column ;
4+ }
5+
6+ .form-container {
7+ @extend %f-column ;
8+
9+ gap : 24px ;
10+
11+ form {
12+ @extend %f-column ;
13+
14+ justify-content : center ;
15+ gap : 24px ;
16+ }
17+
18+ span {
19+ font-size : 24px ;
20+ }
21+
22+ section {
23+ display : flex ;
24+ gap : 6px ;
25+ }
26+
27+ form > div {
28+ @extend %f-column ;
29+
30+ align-items : flex-start ;
31+ justify-content : center ;
32+ gap : 8px ;
33+
34+ div {
35+ display : flex ;
36+ gap : 6px ;
37+ }
38+ }
39+
40+ input {
41+ margin : 0 ;
42+ }
43+ }
You can’t perform that action at this time.
0 commit comments