CSS isn’t my strong point and I am new to working with vue. I have a project on github that is a super simple example. basic renders the scene. I’ve set up shift-ctrl-alt-i to bring up the inspector. But it doesn’t render correctly.
I don’t understand how vue is manipulating the css. There are two locations in the code that I know of where the css is defined:
- App.vue
<style>
html, body, div, canvas {
padding: 0;
margin: 0;
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
- HelloWorld.vue
<style scoped>
#canvas {
width: 100%;
height: 100%;
}
</style>
I thought I was able to fix that by removing div
from App.vue, but that creates another problem where I seem to have a fixed aspect ratio and field of view, no longer filling out the entire browser window.
In the following image, you can see how there’s a block of white space.
And then bringing up the inspector really messes with the canvas.
I’ve tried reverting back to the original css for App.vue, which is:
#app {
font-family: 'Avenir', Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
But this creates a very small canvas:
When I look at the browser’s tools, there’s a ton of <style/>
entries in there that are generated by vue. I don’t know if these are related to my problem or not.
I started working with vue because it was recommended to be easier to use for a beginner and I wouldn’t need to worry too much about setting up the frameworks. But I don’t know enough to code my way out of this mess.