@@ -100,6 +100,16 @@ <h1>Basic Example</h1>
100
100
}
101
101
`
102
102
103
+ const ReadonlyStyledInput = styled . default ( StyledInput ) . attrs ( { readOnly : true } ) `
104
+ color: ${ props => props . theme . disabled } ;
105
+ border-color: ${ props => props . theme . disabled } ;
106
+ font-family: ${ props => props . noop } ;
107
+
108
+ &:focus {
109
+ border-color: ${ props => props . theme . disabled } ;
110
+ }
111
+ `
112
+
103
113
const Btn = styled . default ( 'button' , { visible : Boolean } ) `
104
114
outline: none;
105
115
border: none;
@@ -138,7 +148,7 @@ <h1>Basic Example</h1>
138
148
el : '#container' ,
139
149
data : {
140
150
text1 : 'Hello World, this is my first styled component!' ,
141
- text2 : 'Hello World, this is my first styled component!' ,
151
+ text2 : 'Hello World, this is my first styled component, I am readonly using .attrs function !' ,
142
152
animated1 : false ,
143
153
animated2 : false ,
144
154
element : 'div' ,
@@ -148,7 +158,8 @@ <h1>Basic Example</h1>
148
158
<theme-provider :theme="{
149
159
primary: 'palevioletred',
150
160
secondary: 'papayawhip',
151
- tertiary: 'lavenderblush'
161
+ tertiary: 'lavenderblush',
162
+ disabled: 'gainsboro'
152
163
}">
153
164
<wrapper>
154
165
<custom-title :visible="true" :animate="animated1"> {{text1}} </custom-title>
@@ -157,7 +168,7 @@ <h1>Basic Example</h1>
157
168
</wrapper>
158
169
<w-2>
159
170
<h-2 :animate="animated2"> {{text2}} </h-2>
160
- <styled-input v-model="text2" />
171
+ <readonly- styled-input v-model="text2" />
161
172
<super-btn visible @click="animated2 = !animated2"> An extension of Styled Button </super-btn>
162
173
</w-2>
163
174
<w-3
@@ -191,7 +202,8 @@ <h3>Enter any HTML element and see the element rendered by the styled component
191
202
CustomBtn,
192
203
SuperCustomTitle,
193
204
StyledInput,
194
- 'theme-provider' : styled . ThemeProvider ,
205
+ ReadonlyStyledInput,
206
+ ThemeProvider : styled . ThemeProvider ,
195
207
} ,
196
208
methods : {
197
209
updateElement ( ) {
0 commit comments