fifthbeat / styled-stencils Goto Github PK
View Code? Open in Web Editor NEWA styled-component like library for StencilJS
License: GNU General Public License v3.0
A styled-component like library for StencilJS
License: GNU General Public License v3.0
I'm using display: flex
and appear not apply on elements.
const StyledIcon = styled.span`
display: flex;
`;
Using div
or span
whethever, the result is the same.
return (
<Host>
<StyledIcon>
<div>Column 1</div>
<div>Column 2</div>
</StyledIcon>
</Host>
);
For tests, adding display: flex;
on dynamic created element
Hi! I'm trying to use as Prop
-> documentation here <- but it doesn't work.
I have this StyledComponent:
export const Text = styled.div`
color: #333333;
font-size: 1.5rem;
`;
export class TheText {
@Prop() text: string;
@Prop() taghtml: string;
render() {
return (
<Host>
<Text as={this.taghtml}>{this.text}</Text>
</Host>
);
}
}
I use TheText
component:
<the-text text="Hi! I'm a text" taghtml="p"/>
And the DOM always show the tag: div
<the-text text="Hi! I'm a text" taghtml="p">
<div>Hi! I'm a text</div>
</the-text>
While trying to create a button, I discovered that the following code won't render props to the styled component.
Stripped back code:
const Button = styled.button`
...
`
@Component({
tag: 'my-button'
})
export class MyButton {
@Prop() isDisabled?: boolean;
render () {
return (
<Button disabled={this.isDisabled}></Button>
)}
}
<my-button is-disabled></my-button>
When rendering the component, the attribute disabled isn't rendered on the element. On the host the is-disabled prop is visible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.