-
AuthorPosts
-
August 21, 2014 at 6:21 pm #89689
With your current setup how would I create a child scss theme? I currently am using the child-icon theme.
August 21, 2014 at 6:51 pm #89704Hi Jeff,
Thanks for writing in.
You can use import with your child theme’s scss.
For example, we’re using Icon child theme.
/* Theme Name: X - Child Theme: Icon Theme URI: http://theme.co/x/ Author: Themeco Author URI: http://theme.co/ Description: Make all of your modifications to Icon in this child theme. Version: 1.0.0 Template: x */ @import url( '../x/framework/css/site/stacks/icon.css' ); @import url( 'style.scss' );
style.scss should be inside your child theme’s root directory. X core does not have scss files which means there is no need to override by child. And all you have to do is include your own scss at your child theme.
Hope this helps.
August 21, 2014 at 7:38 pm #89735So you’re saying all I need to do is create a scss file called style.scss and put it under x-child-icon/framework/scss and include the above code? Or are you saying I’m free to write in the x/framework/scss/style/scss file without it being over overwritten?
What I’m going to do is include this icon into my theme http://codepen.io/bennettfeely/pen/twbyA
Thank you for the clarity.
August 21, 2014 at 8:22 pm #89759Hi Jeff,
Yes, you have to create your own style.scss under /x-child-icon/ and not under /x-child-icon/framework/scss/. And import it like this
@import url( 'style.scss' );
It will not overwritten by update, all files added in child theme will not be overwritten unless you accidentally upload the same child theme with same files.
You’re always welcome.
October 7, 2014 at 3:13 pm #120815When doing this I keep getting
“Resource interpreted as Stylesheet but transferred with MIME type text/plain” in the console log in google Chrome.Am I missing something? I would also very much like to be able to create custom scss files.
October 8, 2014 at 12:05 am #121069Hey There,
sorry for the confusion. You can’t include scss files into the style.css/child theme file. Importing only works with .css files so you first have to compile the scss file into a .css file and then you can import that .css file. There are some plugins for WordPress that can automate that compiling which would resolve that issue for you.
Let me know if you have any additional questions.
October 8, 2014 at 2:44 pm #121592Cool 🙂 Thanks for the clarification.
To anyone else stumbling upon this thread, this is how I ended up solving it for my work-flow…
I use Coda 2 (by PANIC), found this great plugin http://elbongurk.com/2013/11/how-to-use-sass-in-coda/ that automatically compiles (and if you want, minifies) your scss file to a css version in the same folder. So for ease of use I just import the my-custom-style.css in the style.css file (in my child theme folder), and then I can work with the scss file as is. Quick, easy and painless 😉Happy tweaking everyone!
October 8, 2014 at 6:06 pm #121773Thank you for sharing this with the rest of the community! 🙂
October 8, 2014 at 10:05 pm #121875But of course, sharing is caring 😉
October 9, 2014 at 5:24 am #122045Indeed it is!
September 26, 2015 at 11:11 am #599535This reply has been marked as private.September 26, 2015 at 11:58 am #599563Hi There,
You have to compile the SCSS file to CSS file first, then import it via child theme.
For more information, you can take a look here:
– https://www.jetbrains.com/webstorm/help/transpiling-sass-less-and-scss-to-css.html
– http://sass-lang.com/documentation/Hope it helps!
September 27, 2015 at 2:13 pm #600446This reply has been marked as private.September 27, 2015 at 7:10 pm #600615Hello There,
Thanks for the updates.
You can use what ever you are comfortable with. We do recommend Sass since we are using it in X.Cheers.
-
AuthorPosts