Skip to content

Commit

Permalink
Cleaned up theme styles and naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbaker committed Apr 9, 2019
1 parent 0c6630f commit b1d0123
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 39 deletions.
20 changes: 1 addition & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,5 @@
logs
*.log

# build/bundle files
static/build*
static/bundle*
*.map
bundleStats.json

# Runtime data
pids
*.pid
*.seed

node_modules
# file system junk
.DS_Store
.deploy.config.js
.deployrc.json

# backstop testing
backstop_data/*
!backstop_data/bitmaps_reference
!backstop_data/engine_scripts
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"useTabs": false
}
59 changes: 59 additions & 0 deletions css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Style Dashboard
* By Drew Baker - 2011
* [email protected]
*
*/

/*
* Logo Icon
*/
#wpwrap #wpadminbar #wp-admin-bar-wp-logo > .ab-item {
background-image: url(../favicon.png);
background-position: center center;
background-repeat: no-repeat;
background-size: 26px auto;
background-color: #ffffff;
}
#wpwrap #wpadminbar #wp-admin-bar-wp-logo > .ab-item span {
visibility: hidden;
}

/*
* Turn off menus
*/
body:not(.is-developer) #toplevel_page_edit-post_type-acf-field-group {
display: none;
}
/*
#menu-posts {
display: none;
}
#menu-media {
display: none;
}
#menu-links {
display: none;
}
#menu-pages {
display: none;
}
#menu-appearance {
display: none;
}
#menu-plugins {
display: none;
}
#menu-users {
display: none;
}
#menu-tools {
display: none;
}
#menu-settings {
display: none;
}
*/
#menu-comments {
display: none;
}
122 changes: 122 additions & 0 deletions css/login.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*
* Style login page
*/

/*
* Globals
*/
:root {
--main-color: white;
--accent-color: black;
--text-color: black;
--hover-text-color: #00a0d2;
}
html {
background: var(--main-color);
}
body.login {
font-size: 14px;
background: var(--main-color);
line-height: 1.4;
padding: 0;
margin: 0;
border: none;
width: 100%;
}
a {
outline: none;
}

/*
* Login Banner Image
*/
#login h1 a {
background-image: url(../images/logo.svg);
background-position: center center;
margin: 0;
background-size: auto;
width: auto;
}

/*
* Login Form
*/
#loginform {
box-shadow: none;
background: var(--main-color);
}
#loginform label {
color: var(--text-color);
}
#loginform input[type='text'],
#loginform input[type='password'] {
background: #f2f2f2;
border: 1px solid #cccccc;
font-family: inherit;
padding: 5px 8px;
box-sizing: border-box;
}
#loginform input[type='checkbox'],
#loginform input[type='radio'] {
vertical-align: baseline;
}

/*
* Login Submit Button
*/
#wp-submit {
background: var(--accent-color);
color: var(--main-color);
border: none;
text-shadow: none;
box-shadow: none;
text-transform: uppercase;
border: 2px solid var(--accent-color);
height: initial;
padding-top: 2px;
}
#wp-submit:hover,
#wp-submit:focus {
background: var(--main-color);
color: var(--accent-color);
border: 2px solid var(--text-color);
}

/*
* "Lost password" link
*/
#nav {
text-shadow: none;
}
.login #nav a {
text-decoration: none;
padding: 0 1px;
text-shadow: none;
color: var(--text-color);
text-decoration: underline;
}
.login #nav a:hover,
.login #nav a:focus {
color: var(--hover-text-color) !important;
font-weight: normal;
text-shadow: none;
}

/*
* "Back to blog" link header
*/
#backtoblog {
display: none;
}
.login .message,
.login #login_error {
background-color: var(--main-color);
color: var(--text-color);
}
.login #login_error a {
color: var(--text-color);
}
.login #login_error a:hover,
.login #login_error a:focus {
color: var(--hover-text-color);
}
9 changes: 4 additions & 5 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
/*
* This file is the main entry point for WordPress functions.
*/

// Misc WordPress functions
include_once get_template_directory() . '/functions/wp-functions.php';

Expand All @@ -18,8 +17,8 @@
/*
* Generally you don't have to edit any of the files below
*/
// Handles plugin dependencies
include_once get_template_directory() . '/functions/plugin-importer.php';
// Handles plugin dependencies
include_once get_template_directory() . '/functions/plugin-importer.php';

// Handles Developer role
include_once get_template_directory() . '/functions/developer-role.php';
// Handles Developer role
include_once get_template_directory() . '/functions/developer-role.php';
25 changes: 13 additions & 12 deletions functions/wp-functions.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
/*
* Setup WordPress
* TODO Get preview URLs working: https://gist.githubusercontent.com/resir014/28bd011b909c44cb9a9bcfce8a63b0b6/raw/7e388ba7bd21c6981769c95f972865b0622c926a/functions.php
*/
function custom_wordpress_setup() {

Expand All @@ -9,7 +10,7 @@ function custom_wordpress_setup() {

// Enable excerpts for pages
add_post_type_support('page', 'excerpt');

// Add theme options page
// if( function_exists('acf_add_options_page') ) {
// acf_add_options_page(array(
Expand Down Expand Up @@ -68,10 +69,10 @@ function custom_loginpage_logo_title($message) {
return get_bloginfo('name');
}
function custom_loginpage_styles() {
wp_enqueue_style( 'login_css', get_template_directory_uri() . '/static/css/login.css' );
wp_enqueue_style('login_css', get_template_directory_uri() . '/css/login.css');
}
function custom_admin_styles() {
wp_enqueue_style('admin-stylesheet', get_template_directory_uri() . '/static/css/admin.css');
wp_enqueue_style('admin-stylesheet', get_template_directory_uri() . '/css/admin.css');
}
add_filter('login_headerurl','custom_loginpage_logo_link');
add_filter('login_headertitle','custom_loginpage_logo_title');
Expand Down Expand Up @@ -133,18 +134,18 @@ function custom_excerpt_ellipsis( $more ) {
*/
function my_general_section() {
add_settings_section(
'vh_google_analytics_section', // Section ID
'sh_google_analytics_section', // Section ID
'Google Analytics Tracking IDs', // Section Title
'vh_google_analytics_section', // Callback
'sh_google_analytics_section', // Callback
'general' // This makes the section show up on the General Settings Page
);

add_settings_field(
'ga_tracking_code_1', // Option ID
'Tracking ID #1', // Label
'vh_google_analytics_settings', // !important - This is where the args go!
'sh_google_analytics_settings', // !important - This is where the args go!
'general', // Page it will be displayed (General Settings)
'vh_google_analytics_section', // Name of our section
'sh_google_analytics_section', // Name of our section
array(
'ga_tracking_code_1' // Should match Option ID
)
Expand All @@ -153,9 +154,9 @@ function my_general_section() {
add_settings_field(
'ga_tracking_code_2', // Option ID
'Tracking ID #2', // Label
'vh_google_analytics_settings', // !important - This is where the args go!
'sh_google_analytics_settings', // !important - This is where the args go!
'general', // Page it will be displayed (General Settings)
'vh_google_analytics_section', // Name of our section
'sh_google_analytics_section', // Name of our section
array(
'ga_tracking_code_2' // Should match Option ID
)
Expand All @@ -170,11 +171,11 @@ function my_general_section() {
/*
* Settings callbacks that build the Analytics markup
*/
function vh_google_analytics_section() {
function sh_google_analytics_section() {
echo '<p>Enter Google Analytics tracking codes. Uses the <code>gtag.js</code> tracking method.</p>';
}

function vh_google_analytics_settings($args) {
function sh_google_analytics_settings($args) {
$option = get_option($args[0]);
echo '<input type="text" id="'. $args[0] .'" name="'. $args[0] .'" value="' . $option . '" placeholder="UA-12345678-1"/>';
}
}
6 changes: 3 additions & 3 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Theme Name: MPC 2019
Theme Name: Stackhaus
Theme URI: http://funkhaus.us
Description: A Vue theme for WordPress. Depends on "Rest Easy" plugin by Funkhaus to properly work.
Description: A theme to turn WordPress into a headless CMS
Author: Funkhaus
Author URI: http://www.funkhaus.us
Text Domain: vuehaus
Text Domain: stackhaus
Version: 1.0.0
*/

0 comments on commit b1d0123

Please sign in to comment.