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

BZ#145849913 Allows for image assets to be dynamically skinned #790

Merged
merged 5 commits into from
May 26, 2017
Merged
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
2 changes: 2 additions & 0 deletions client/app/core/shopping-cart/_shopping-cart.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.cart-duplicate-icon
padding: 0 .5em
3 changes: 0 additions & 3 deletions client/app/core/shopping-cart/_shopping-cart.scss

This file was deleted.

2 changes: 1 addition & 1 deletion client/app/core/shopping-cart/shopping-cart.component.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import './_shopping-cart.scss';
import './_shopping-cart.sass';
import templateUrl from './shopping-cart.html';

export const ShoppingCartComponent = {
Expand Down
3 changes: 1 addition & 2 deletions client/app/layouts/_application.sass
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Product overrides of Boostrap & Patternfly variables

$modal-about-pf-bg-color: #083c5a
// sets background color of 'About' modal

Expand All @@ -8,7 +7,7 @@ $modal-about-pf-bg-color: #083c5a

.about-modal-pf
background-color: $modal-about-pf-bg-color
background-image: url('../images/bg-modal-about-pf.png')
background-image: url('#{$img-base-path}images/bg-modal-about-pf.png')

// @font-face
// font-family: 'FontAwesome'
Expand Down
2 changes: 1 addition & 1 deletion client/app/layouts/_navigation.sass
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.navbar-pf-vertical
background-color: $app-color-dark-blue-gray
background-image: url('../images/bg-navbar.png')
background-image: url('#{$img-base-path}images/bg-navbar.png')
background-repeat: no-repeat
background-size: auto 100%

Expand Down
23 changes: 12 additions & 11 deletions client/app/states/login/_login.sass
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
@import '_bem-support/index'

+block(login-pf)
+element(img)
+modifier(top)
left: 0
top: 0
+modifier(bottom)
bottom: 0
position: fixed
right: 0


background-color: $app-color-deep-blue
background-image: url('../images/bg-login-2.png')
background-position: 100% 100%
background-repeat: no-repeat
background-size: auto
height: calc(100vh)
margin-bottom: -38px
margin-top: -60px

&::before
background: transparent
background-position: 0% 0%
background-repeat: no-repeat
background-size: auto
content: url('../images/bg-login.png')

.container
background-color: transparent

Expand Down
4 changes: 3 additions & 1 deletion client/app/states/login/login.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<div class="login-pf">
<img class="login-pf__img--top" src="./images/bg-login.png" alt="top-corner" />
<img class="login-pf__img--bottom" src="./images/bg-login-2.png" alt=" bottom-corner" />
<span id="badge">
<img class="logo" src="images/login-screen-logo.png" alt=" logo" />
<img class="logo" src="./images/login-screen-logo.png" alt=" logo" />
</span>
<div class="container">
<div class="row">
Expand Down
9 changes: 9 additions & 0 deletions client/assets/sass/_patternfly.sass
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Bootstrap path variables
$icon-font-path: '~bootstrap-sass/assets/fonts/bootstrap/'
// Font Awesome path variables
$fa-font-path: '~font-awesome/fonts'
// Patternfly path variables
$img-path: '~patternfly-sass/assets/images/patternfly/'
$font-path: '~patternfly-sass/assets/fonts/patternfly/'

@import '~patternfly-sass/assets/stylesheets/patternfly'
9 changes: 0 additions & 9 deletions client/assets/sass/_patternfly.scss

This file was deleted.

3 changes: 3 additions & 0 deletions client/assets/sass/styles.sass
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Global constants
$img-base-path: '/' !default

@import 'patternfly'

// BEM Support : See _bem-support/_index.sass for more information
Expand Down
18 changes: 15 additions & 3 deletions config/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const nodeModules = path.resolve(__dirname, '../node_modules');
const protocol = process.env.PROXY_PROTOCOL || 'http://';
const host = process.env.PROXY_HOST || process.env.MOCK_API_HOST || '[::1]:3000';
const hasSkinImages = fs.existsSync(`${root}/skin/images`);
const appBasePath = process.env.NODE_ENV === 'production' ? "'/ui/service/'" : "'/'";

console.log("Backend proxied on " + protocol + host);

Expand Down Expand Up @@ -113,16 +114,27 @@ module.exports = {

// css loaders: extract styles to a separate bundle
{
test: /\.(css|s(a|c)ss)$/,
test: /\.(css)$/,
use: ExtractTextWebpackPlugin.extract({
fallback: 'style-loader',
allChunks: true,
loader: [
'css-loader?importLoaders=2&sourceMap=true',
use: [
'css-loader?importLoaders=1&sourceMap=true',
'postcss-loader',
],
}),
},
{
test: /\.(sass|scss)$/,
use: ExtractTextWebpackPlugin.extract({
fallback: 'style-loader',
allChunks: true,
use: [
'css-loader?importLoaders=1&sourceMap=true',
{
loader: 'sass-loader',
options: {
data: `$img-base-path: ${appBasePath}`,
sourceMap: true,
includePaths: [
`${root}/assets/sass`,
Expand Down