Skip to content

Commit

Permalink
Added custom css in example (#457)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-yao authored Jul 29, 2019
1 parent 4151a6d commit b948942
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 8 deletions.
8 changes: 8 additions & 0 deletions examples/vic-gov-au/assets/_custom.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@import "~@dpc-sdp/ripple-global/style";

// Example custom css
.tide-page--demo_landing_page {
.example-message {
background-color: rgb(217, 217, 217)
}
}
5 changes: 4 additions & 1 deletion examples/vic-gov-au/components/examples/Message.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<h1>{{text}}</h1>
<div class="example-message">
<h2>This is a example of custom component</h2>
<p>{{text}}</p>
</div>
</template>

<script>
Expand Down
7 changes: 7 additions & 0 deletions examples/vic-gov-au/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ export default {
}]
],
/*
** Css
* https://nuxtjs.org/api/configuration-css/
*/
css: [
'@/assets/_custom.scss'
],
/*
** styleResources
* Override the path to the theme customisation scss
* loads scss with @nuxtjs/style-resources
Expand Down
2 changes: 0 additions & 2 deletions packages/ripple-nuxt-tide/lib/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,4 @@ export default {
@import "~@dpc-sdp/ripple-global/style";
@import "~@dpc-sdp/ripple-nuxt-tide/lib/components/scss/wysiwyg/_embedded-entity-video.scss";
@import "~@dpc-sdp/ripple-nuxt-tide/lib/components/scss/wysiwyg/_embedded-entity.scss";
// @import "~assets/_custom.scss";
// TODO : these ~ alias wont work, need a different way
</style>
5 changes: 0 additions & 5 deletions packages/ripple-nuxt-tide/lib/layouts/minimal.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
<template>
<nuxt/>
</template>

<style lang="scss">
@import "~@dpc-sdp/ripple-global/style";
// @import "~assets/_custom.scss";
</style>
10 changes: 10 additions & 0 deletions test/e2e/integration/CustomCss/CustomCss.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: Custom css should work

Custom css is getting loaded

Background:
Given I visit the page "/demo-landing-page"

@smoke
Scenario: Custom css for example message is applied
And the example message has custom background color
7 changes: 7 additions & 0 deletions test/e2e/integration/CustomCss/CustomCss/step_definition.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* global cy */

import { Then } from 'cypress-cucumber-preprocessor/steps'

Then(`the example message has custom background color`, () => {
cy.get('.example-message').should('have.css', 'background-color', 'rgb(217, 217, 217)')
})
10 changes: 10 additions & 0 deletions test/e2e/integration/CustomMiddleware/CustomMiddleware.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Feature: Custom middleware

Custom middleware should work

Background:
Given I visit the page "/demo-landing-page"

@smoke
Scenario: Example for adding component
And the example message is added
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* global cy */

import { Then } from 'cypress-cucumber-preprocessor/steps'

Then(`the example message is added`, () => {
cy.get('.example-message').should('exist')
})

0 comments on commit b948942

Please sign in to comment.