Community Forums › Forums › Archived Forums › Design Tips and Tricks › Adding custom styles with an external style sheet.
Tagged: custom css
- This topic has 6 replies, 3 voices, and was last updated 7 years, 4 months ago by Andrea Rennick.
-
AuthorPosts
-
July 15, 2017 at 4:47 am #209139westerdaledMember
Hi
If want to add custom styles to my child theme is there a recommended approach?
I guess this is not necessarily the best approach :https://my.studiopress.com/documentation/executive-pro-theme/customize-your-settings/additional-css/ as in a bit lacking in syntax highlighting / version control via GIT.
Alternatively, is the simplest approach to hack styles.css and hope I don't break anything!
July 15, 2017 at 5:37 am #209142Victor FontModeratorThe Additional CSS feature you are referring to in the post is a WordPress Core feature. Code you add in this area extends across your site regardless of the theme in use. It is added as an inline style and overrides the style sheet.
Executive Pro is a WordPress child theme. Child themes are by nature designed to be modified. If you want to change CSS, edit the Executive Pro style sheet. If you want to use an external, supplemental style sheet, enqueue it in functions.php. The "best practice" here is whatever you choose to make it.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 15, 2017 at 9:31 am #209144westerdaledMemberI understand what you are saying. My original thinking was to reduce the impact of updates to the child theme CSS including reapplying my own styles. Not so bad if they were in one place but what if they are scattered around the different sections of styles.cssĀ .
I guess to keep it simple then add changes styles.css and not say the enqueue in functions.php e.g.
https://digitalessence.net/add-extra-css-file-genesis-framework/
July 15, 2017 at 11:36 am #209150Victor FontModeratorEither way is simple, the choice depends on what the CSS is for. If the CSS is for elements contained within the child theme, then add them to style.css. If you switch theme's later on and reuse custom elements, you'll have to cut and paste from the old theme to the new. If you use an external style sheet, you would only have to enqueue it in the new functions file. How much work do you want later?
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 16, 2017 at 10:58 am #209176Andrea RennickMember"My original thinking was to reduce the impact of updates to the child theme CSS including reapplying my own styles. "
Child themes are not upgraded.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
July 16, 2017 at 11:51 am #209181westerdaledMemberAndrea
Unfortunately, child themes do get updated - just not very often!
In my case I plan to do a fresh install of the child theme, once I can transfer a domain to my new host. Thereafter, I can apply my own styles and changes to functions.php.Metro Pro
Type: StudioPress Version: 2.2.1 Updated: 1/31/17July 17, 2017 at 7:32 am #209212Andrea RennickMemberWe may update child themes, but they do not send out upgrade notices. There's a difference.
You are also not expected nor required to update your customized child theme with the latest version.
This is the official position officially coming from support.
**forum signature**
If you need technical support for your theme please file a ticket.The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.