-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Styles not accessible #79
Comments
Does the [class] attribute address your issue? See API section of readme. |
We're working on a more customizable DatePickerComponent. In the meantime, I posted a temporary solution here. |
@gelliott181 Missed that, sorry. Can you explain the issue a little more? Trying to clean up my own CSS as well. Right now I'm including CSS in index.html and styling the generated classes, which feels wrong. |
That is definitely wrong and is the exact same reason why I brought this up. Angular2 encapsulation makes it difficult to do this sort of styling easily, and since I'm using the Angular-CLI I can't seem to extend the class in a way that Angular likes, nor do relative paths look good at all ( If I get my solution working I'll come back with my code and a quick guide. |
@gelliott181 I'm working on a custom annotation @DatePicker({
selector: 'my-datepicker',
styles: ''
})
export class MyDatePickerComponent extends DatePickerComponent { } But I'm having difficulties with aot compilation. If I fail the temporary solution will becomes the only available solution, except we will export template and component on the module for clean imports. |
AoT compilation is causing headaches in every single project I come across. I took a quick look but didn't see the annotation code pushed yet. If you put it up I'm happy to throw some time at figuring it out too. |
@gelliott181 don't bother I just wasted half a day trying which I fell dumb about because I've read a lot about it and how we shouldn't because it cause trouble for aot. I just thought doing something really simple like just overriding styles property would do. But it's not possible without modifying What I learned is that your can't use decorators at all on aot, even those not related to angular 2. Only angular 2 decorators are permit. What is happening is that decorators seems to be handled exclusively by
This seems to work and I'm working this way. What's funny here is that Anyway I'll finish that along with a build system to generate files for all bundlers then it would be really nice if you could test it, see if it's working as you expect it. I won't commit my customs decorators because it only work with JIT but if you're interested I can create a gist. |
Ouch, that I'll keep an eye on #76, and I'm also working on stripping down the current style sheet and template to separate the box model properties from the decorative styles by class. This should allow custom styling without risking breaking the box model or other non-decorative properties on accident. It also provides the opportunity to allow an @input to accept an array of styles (CSS file processing would be nice, but that's a whole other ballgame) that can map to the color tags when the component is instantiated rather than selecting a specific style sheet. I consider this a half-step towards your configurable component. |
has this issue been resolved yet? |
I am unable to add custom style to the component, can anyone help me with it? |
I'm working with your date picker, and while it's a great component I noticed a major problem with attempting to style it: You can't. The provided classes are our only option, and that feels like an incomplete solution.
Perhaps we could attach a
custom
class which allows the parent component to assign styles? Another option would be allowing style settings to get passed in, but that seems clunky and inflexible for the complexity it would involve.The text was updated successfully, but these errors were encountered: