Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating package.json scripts and Sass files for better compatibility with current tooling. #1524

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
657 changes: 305 additions & 352 deletions style-rtl.css → css/style.css

Large diffs are not rendered by default.

597 changes: 257 additions & 340 deletions woocommerce.css → css/woocommerce.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions css/woocommerce.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ function _s_widgets_init() {
* Enqueue scripts and styles.
*/
function _s_scripts() {
wp_enqueue_style( '_s-style', get_stylesheet_uri(), array(), _S_VERSION );
wp_enqueue_style( '_s-style', get_template_directory_uri() . '/css/style.css', _S_VERSION );
//wp_enqueue_style( '_s-style', get_template_directory_uri() . '/css/style.css', array(), filemtime(get_template_directory() . '/css/style.css'), false);
wp_style_add_data( '_s-style', 'rtl', 'replace' );

wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
Expand Down Expand Up @@ -182,3 +183,15 @@ function _s_scripts() {
if ( class_exists( 'WooCommerce' ) ) {
require get_template_directory() . '/inc/woocommerce.php';
}

/**
* Enqueue WooCommerce stylesheet
*/
function wp_enqueue_woocommerce_style(){
wp_register_style( '_s-woocommerce', get_template_directory_uri() . '/css/woocommerce.css' );

if ( class_exists( 'woocommerce' ) ) {
wp_enqueue_style( '_s-woocommerce' );
}
}
add_action( 'wp_enqueue_scripts', 'wp_enqueue_woocommerce_style' );
2 changes: 1 addition & 1 deletion js/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
/**
* Sets or removes .focus class on an element.
*/
function toggleFocus() {
function toggleFocus(event) {
if ( event.type === 'focus' || event.type === 'blur' ) {
let self = this;
// Move up through the ancestors of the current link until we hit .nav-menu.
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"url": "https://github.com/Automattic/_s/issues"
},
"devDependencies": {
"@wordpress/scripts": "^19.2.2",
"dir-archiver": "^1.1.1",
"node-sass": "^7.0.1",
"@wordpress/scripts": "^23.1.0",
"dir-archiver": "^1.2.0",
"sass": "^1.52.1",
"rtlcss": "^3.5.0"
},
"rtlcssConfig": {
Expand All @@ -36,9 +36,9 @@
"map": false
},
"scripts": {
"watch": "node-sass sass/ -o ./ --source-map true --output-style expanded --indent-type tab --indent-width 1 -w",
"compile:css": "node-sass sass/ -o ./ && stylelint '*.css' --fix || true && stylelint '*.css' --fix",
"compile:rtl": "rtlcss style.css style-rtl.css",
"watch": "sass sass/:./css --style expanded -w",
"compile:css": "sass sass/:./css && stylelint '*.css' --fix || true && stylelint '*.css' --fix",
"compile:rtl": "rtlcss ./css/style.css ./css/style-rtl.css",
"lint:scss": "wp-scripts lint-style 'sass/**/*.scss'",
"lint:js": "wp-scripts lint-js 'js/*.js'",
"bundle": "dir-archiver --src . --dest ../_s.zip --exclude .DS_Store .stylelintrc.json .eslintrc .git .gitattributes .github .gitignore README.md composer.json composer.lock node_modules vendor package-lock.json package.json .travis.yml phpcs.xml.dist sass style.css.map yarn.lock"
Expand Down
2 changes: 1 addition & 1 deletion sass/abstracts/mixins/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@

// Column width with margin
@mixin column-width($numberColumns: 3) {
width: map-get($columns, $numberColumns) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns );
width: map-get($columns, $numberColumns) - ( calc(( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns ));
}
Loading