media query and vuejs
up vote
0
down vote
favorite
I’d like to use simple @media query in css section of a component but I can’t make it work.
I prepared a codesandbox.io here in the component HelloWorld.vue:
I would expect to change from red to green when squeezing the window…
What am I doing wrong?
[EDIT: as somebody noted, it's working in some circumstancies, it's still not working if I put this code in a component in vuejs + vuetify (while it works in a component of standard vuejs)]
<style>
.vega
height: 100px;
background-color: red;
@media (max-width: 400px)
.vega
height: 40px;
background-color: green;
</style>
Thanks in advance
sandro
css vuejs2 media-queries vuetify.js codesandbox
add a comment |
up vote
0
down vote
favorite
I’d like to use simple @media query in css section of a component but I can’t make it work.
I prepared a codesandbox.io here in the component HelloWorld.vue:
I would expect to change from red to green when squeezing the window…
What am I doing wrong?
[EDIT: as somebody noted, it's working in some circumstancies, it's still not working if I put this code in a component in vuejs + vuetify (while it works in a component of standard vuejs)]
<style>
.vega
height: 100px;
background-color: red;
@media (max-width: 400px)
.vega
height: 40px;
background-color: green;
</style>
Thanks in advance
sandro
css vuejs2 media-queries vuetify.js codesandbox
The CSS you posted seems to work perfectly well (jsfiddle.net/3yaj9q2m/1); you may need to debug further.
– David Thomas
2 days ago
In fact thanks. Not only it works in pure html, it works in vuejs build with vue-cli. It's probably an issue with codesandbox. But I still have the problme as it does not work in vuetify
– Alessandro Dentella
yesterday
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I’d like to use simple @media query in css section of a component but I can’t make it work.
I prepared a codesandbox.io here in the component HelloWorld.vue:
I would expect to change from red to green when squeezing the window…
What am I doing wrong?
[EDIT: as somebody noted, it's working in some circumstancies, it's still not working if I put this code in a component in vuejs + vuetify (while it works in a component of standard vuejs)]
<style>
.vega
height: 100px;
background-color: red;
@media (max-width: 400px)
.vega
height: 40px;
background-color: green;
</style>
Thanks in advance
sandro
css vuejs2 media-queries vuetify.js codesandbox
I’d like to use simple @media query in css section of a component but I can’t make it work.
I prepared a codesandbox.io here in the component HelloWorld.vue:
I would expect to change from red to green when squeezing the window…
What am I doing wrong?
[EDIT: as somebody noted, it's working in some circumstancies, it's still not working if I put this code in a component in vuejs + vuetify (while it works in a component of standard vuejs)]
<style>
.vega
height: 100px;
background-color: red;
@media (max-width: 400px)
.vega
height: 40px;
background-color: green;
</style>
Thanks in advance
sandro
css vuejs2 media-queries vuetify.js codesandbox
css vuejs2 media-queries vuetify.js codesandbox
edited yesterday
asked 2 days ago
Alessandro Dentella
18011
18011
The CSS you posted seems to work perfectly well (jsfiddle.net/3yaj9q2m/1); you may need to debug further.
– David Thomas
2 days ago
In fact thanks. Not only it works in pure html, it works in vuejs build with vue-cli. It's probably an issue with codesandbox. But I still have the problme as it does not work in vuetify
– Alessandro Dentella
yesterday
add a comment |
The CSS you posted seems to work perfectly well (jsfiddle.net/3yaj9q2m/1); you may need to debug further.
– David Thomas
2 days ago
In fact thanks. Not only it works in pure html, it works in vuejs build with vue-cli. It's probably an issue with codesandbox. But I still have the problme as it does not work in vuetify
– Alessandro Dentella
yesterday
The CSS you posted seems to work perfectly well (jsfiddle.net/3yaj9q2m/1); you may need to debug further.
– David Thomas
2 days ago
The CSS you posted seems to work perfectly well (jsfiddle.net/3yaj9q2m/1); you may need to debug further.
– David Thomas
2 days ago
In fact thanks. Not only it works in pure html, it works in vuejs build with vue-cli. It's probably an issue with codesandbox. But I still have the problme as it does not work in vuetify
– Alessandro Dentella
yesterday
In fact thanks. Not only it works in pure html, it works in vuejs build with vue-cli. It's probably an issue with codesandbox. But I still have the problme as it does not work in vuetify
– Alessandro Dentella
yesterday
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You have not specified the media type to apply the rule too like print or screen
@media screen and (max-width: 400px)
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You have not specified the media type to apply the rule too like print or screen
@media screen and (max-width: 400px)
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
add a comment |
up vote
0
down vote
You have not specified the media type to apply the rule too like print or screen
@media screen and (max-width: 400px)
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
add a comment |
up vote
0
down vote
up vote
0
down vote
You have not specified the media type to apply the rule too like print or screen
@media screen and (max-width: 400px)
You have not specified the media type to apply the rule too like print or screen
@media screen and (max-width: 400px)
answered 2 days ago
Marc Newton
1,5751317
1,5751317
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
add a comment |
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
No, this is not the problem. This is legitimate, in fact it works in th jsfiddle reported above. The problem must be inherent to vuetify and single file components
– Alessandro Dentella
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
I tried it in fiddle js and that worked with screen but not without when in the scope of VUE. For some reason Vue does not like the media type target being omitted even is valid in standard css.
– Marc Newton
yesterday
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53238285%2fmedia-query-and-vuejs%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
The CSS you posted seems to work perfectly well (jsfiddle.net/3yaj9q2m/1); you may need to debug further.
– David Thomas
2 days ago
In fact thanks. Not only it works in pure html, it works in vuejs build with vue-cli. It's probably an issue with codesandbox. But I still have the problme as it does not work in vuetify
– Alessandro Dentella
yesterday