Skip to content

Commit

Permalink
fix(radio): fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
alyleui committed Oct 14, 2018
1 parent ff73206 commit d2c76cd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p>
<ly-radio-group [formControl]="appearance">
<p>Appearance:</p>
<span>Appearance:</span>
<ly-radio value="standard" checked>Standard</ly-radio>
<ly-radio value="outlined">Outlined</ly-radio>
<ly-radio value="filled">Filled</ly-radio>
Expand Down
6 changes: 4 additions & 2 deletions src/lib/radio/radio.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ const STYLE_PRIORITY = -2;

const styles = ({
root: {
display: 'flex',
flexWrap: 'wrap'
display: 'inline-block'
},
labelContent: {
padding: '0 0.5em'
},
radioButton: {
display: 'inline-block'
}
});

Expand Down
13 changes: 8 additions & 5 deletions src/lib/radio/radio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ const styles = theme => ({
whiteSpace: 'nowrap',
position: 'relative',
display: 'flex',
alignItems: 'center'
alignItems: 'baseline'
},
container: {
position: 'relative',
height: 'calc(1em * 3)',
width: '1.5em',
margin: 'auto',
'&>div *': {
margin: 'auto',
borderRadius: '50%',
Expand All @@ -72,7 +72,7 @@ const styles = theme => ({
}
}
});
// console.log('module.id', module.id);

@Component({
selector: 'ly-radio-group',
template: `<ng-content></ng-content>`,
Expand Down Expand Up @@ -339,7 +339,8 @@ export class LyRadio implements OnInit, OnDestroy {
this._ripple = new Ripple(this.theme.config, this.ngZone, this._rippleService.classes, this._radioContainer.nativeElement, this._elementRef.nativeElement);
this._ripple.setConfig({
centered: true,
radius: 'containerSize'
radius: 'containerSize',
percentageToIncrease: 100
});
}

Expand All @@ -361,7 +362,9 @@ export class LyRadio implements OnInit, OnDestroy {
private ngZone: NgZone,
public coreStyles: LyCoreStyles,
private _rippleService: LyRippleService
) { }
) {
_renderer.addClass(_elementRef.nativeElement, radioGroup._radioService.classes.radioButton);
}
}

@NgModule({
Expand Down

0 comments on commit d2c76cd

Please sign in to comment.