Last active
May 7, 2021 21:10
-
-
Save ASH-Michael/9712cdae49ae871cdb87e30919c917e6 to your computer and use it in GitHub Desktop.
Component Stacking Contexts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['my-component'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
classNames: ['slider-component'] | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
PARENT WEBSITE | |
outside of my control | |
*/ | |
body { | |
width: 100%; | |
margin: 0; | |
font-family: Verdana; | |
text-align: center; | |
background-color: white; | |
} | |
.header { | |
width: 100%; | |
height: 5rem; | |
background-color: rgb(255, 255, 220); | |
/* stacking context */ | |
position: fixed; | |
z-index: 600; | |
} | |
.main { | |
padding-top: 5rem; | |
background-color: rgb(220, 255, 255); | |
height: 1500px; | |
} | |
.main .title { | |
margin: 2rem 0 0; | |
} | |
.footer { | |
width: 100%; | |
height: 5rem; | |
background-color: rgb(255, 255, 220); | |
} | |
.title { | |
display: block; | |
font-size: 2rem; | |
} | |
/* | |
THIRD PARTY COMPONENT | |
{{slider-component}} | |
(black box) out of my control | |
*/ | |
.slider-component { | |
/* stacking context */ | |
position: relative; | |
} | |
.slider-container { | |
margin: 0 auto; | |
width: 20rem; | |
height: 10rem; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
background: orange; | |
/* stacking context */ | |
z-index: 1; | |
} | |
.slider-component svg { | |
width: 40px; | |
height: 40px; | |
color: orange; | |
position: absolute; | |
top: 60px; | |
cursor: pointer; | |
/* stacking context */ | |
z-index: 999; | |
} | |
.slider-component svg path { | |
fill: currentColor; | |
} | |
.slider-component .leftArrow { | |
left: 75px; | |
} | |
.slider-component .rightArrow { | |
right: 75px; | |
} | |
/* | |
MY COMPONENT | |
{{my-component}} | |
completely under my control | |
*/ | |
.my-component { | |
padding: 20px; | |
background: lightgray; | |
position: relative; | |
z-index: 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment