1

I want to make some modifications to the bartik theme i am using D8 (like changing the logo position,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-theme-or-sub-theme-of-sub-theme

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;
}

When i go back to 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.

Thank you.

  • Just to be sure: did you change to your new theme in admin/appearance and did you clear cache? – Wim Mostrey Jan 24 '17 at 8:35
  • yes, i did set as default the new theme and i cleared the cache – kyriakib Jan 24 '17 at 10:08
1

Not sure if this is still relevant or not but I was having the same issue and I was just missing a dash.

libraries:
mytheme/global-styling

to

libraries:
- mytheme/global-styling

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.