understrap-child

Basic Child Theme for UnderStrap Theme Framework

Github星跟踪图

understrap-child

Basic Child Theme for UnderStrap Theme Framework: https://github.com/understrap/understrap

How it works

Understrap Child Theme shares with the parent theme all PHP files and adds its own functions.php on top of the UnderStrap parent theme's functions.php.

IT DOES NOT LOAD THE PARENT THEMES CSS FILE(S)! Instead it uses the UnderStrap Parent Theme as a dependency via npm and compiles its own CSS file from it.

Understrap Child Theme uses the Enqueue method to load and sort the CSS file the right way instead of the old @import method.

Installation

  1. Install the parent theme UnderStrap first: https://github.com/understrap/understrap
    • IMPORTANT: If you download UnderStrap from GitHub make sure you rename the "understrap-master.zip" file to "understrap.zip" or you might have problems using this child theme!
  2. Upload the understrap-child folder to your wp-content/themes directory
  3. Go into your WP admin backend
  4. Go to "Appearance -> Themes"
  5. Activate the UnderStrap Child theme

Editing

Add your own CSS styles to /sass/theme/_child_theme.scss
or import you own files into /sass/theme/understrap-child.scss

To overwrite Bootstrap's or UnderStrap's base variables just add your own value to:
/sass/theme/_child_theme_variables.scss

For example, the "$brand-primary" variable is used by both Bootstrap and UnderStrap.

Add your own color like: $brand-primary: #ff6600; in /sass/theme/_child_theme_variables.scss to overwrite it. This change will automatically apply to all elements that use the $brand-primary variable.

It will be outputted into:
/css/understrap-child.min.css and /css/understrap-child.css

So you have one clean CSS file at the end and just one request.

Developing With NPM, Gulp, SASS and Browser Sync

Installing Dependencies

  • Make sure you have installed Node.js, Gulp, and Browser-Sync [1] on your computer globally
  • Open your terminal and browse to the location of your UnderStrap copy
  • Run: $ npm install then: $ gulp copy-assets

Running

To work and compile your Sass files on the fly start:

  • $ gulp watch

Or, to run with Browser-Sync:

  • First change the browser-sync options to reflect your environment in the file /gulpconfig.json in the beginning of the file:
  "browserSyncOptions" : {
    "proxy": "localhost/wordpress/",
    "notify": false
  }
};
  • then run: $ gulp watch-bs

[1] Visit https://browsersync.io/ for more information on Browser Sync

主要指标

概览
名称与所有者understrap/understrap-child
主编程语言CSS
编程语言CSS (语言数: 4)
平台
许可证GNU General Public License v3.0
所有者活动
创建于2015-03-18 10:39:50
推送于2023-10-11 04:24:44
最后一次提交
发布数36
最新版本名称v1.2.0 (发布于 2022-12-09 11:49:46)
第一版名称0.1.0 (发布于 )
用户参与
星数584
关注者数54
派生数335
提交数268
已启用问题?
问题数280
打开的问题数19
拉请求数43
打开的拉请求数2
关闭的拉请求数39
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?