Hello,
I am new to Drupal. I want to make some modifications to the bartik theme i am using D8 (like changing the logo position, changing the size of font in article titles, etc) i created a subtheme named it "mytheme" following the instruction i found here:
https://www.drupal.org/docs/8/theming-drupal-8/creating-a-drupal-8-sub-t...
So, first I created the mytheme.info.yml file containing:
name: mytheme
type: theme
base theme: bartik
description: subtheme for bartik
core: 8.x
libraries:
mytheme/global-styling
regions:
header: Header
primary_menu: 'Primary menu'
secondary_menu: 'Secondary menu'
page_top: 'Page top'
page_bottom: 'Page bottom'
highlighted: Highlighted
featured_top: 'Featured top'
breadcrumb: Breadcrumb
content: Content
sidebar_first: 'Sidebar first'
sidebar_second: 'Sidebar second'
featured_bottom_first: 'Featured bottom first'
featured_bottom_second: 'Featured bottom second'
featured_bottom_third: 'Featured bottom third'
footer_first: 'Footer first'
footer_second: 'Footer second'
footer_third: 'Footer third'
footer_fourth: 'Footer fourth'
footer_fifth: 'Footer fifth'
Next i created the mytheme.libraries.yml containing the following:
global-styling:
css:
theme:
css/style.css: {}
I went to appearance and enabled "mytheme" as default, went back to site, looks identical to how bartik was, so far so good.
My problem now is, how do i move on with the customizations i want to do?
I created a folder called: "css" in "mytheme" directory, inside the css folder i created a blank file called "style.css" and there i wrote the first modification i want to do
.region-header .site-branding {
float: none;
text-align: center;
}
I flushed the cache but when I go back to the site I see no difference, the logo remains on the left like it was on bartik.
Can somebody help please?
I am not sure how to proceed and if what I did by creating a css folder, etc is the right way.
I read a lot and saw there is no style.css file in bartik D8. I am confused. How can my subtheme customizations work properly?
Thank you.
Comments
Register the CSS file
You need to register the CSS file, like this:
In mytheme.info.yml:
In mytheme.libraries.yml:
Thank you for your reply.
Thank you for your reply.
I did but again it makes no difference.
I have no idea what is going wrong.
I will keep searching and trying.
Thank you very much again!
It finally worked!I appreciate your help.
I don't know if it has anything to do but uninstalled some modules I didn't need and it worked!
All the best.
Great to hear that you got it
Great to hear that you got it working!