Skip to content

Commit

Permalink
ADSDEV-1117 fix broken x-privacy-manager stylesheet and convert to st…
Browse files Browse the repository at this point in the history
…yled component
  • Loading branch information
alevito committed Jun 22, 2022
1 parent ff26a3b commit 18b3614
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 2 additions & 0 deletions components/x-privacy-manager/src/components/radio-btn.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { h } from '@financial-times/x-engine'

import './radio-btn.scss'

/**
* @param {{
* name: string,
Expand Down
12 changes: 6 additions & 6 deletions components/x-privacy-manager/src/components/radio-btn.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $transitionDuration: 0.1s;
.x-privacy-manager-radio-button {
flex: 1;

& + .control {
& + .x-privacy-manager-radio-button {
margin-top: oSpacingByName(s4);

@include oGridRespondTo($from: S) {
Expand All @@ -38,14 +38,14 @@ $transitionDuration: 0.1s;
cursor: pointer;
background-color: oColorsByName('white');

.input:checked + & {
.x-privacy-manager-radio-button__input:checked + & {
background-color: oColorsByName('teal');
color: oColorsByName('white');
}

// Since <input> itself is hidden, apply a familiar focus style to the visible <label>
// As adjacent siblings we can reflect the <input>'s focus state here
.input:focus + & {
.x-privacy-manager-radio-button__input:focus + & {
outline: 2px solid oColorsByName('teal-40');
outline-offset: 3px;
background-color: oColorsByName('teal-40');
Expand Down Expand Up @@ -87,7 +87,7 @@ $transitionDuration: 0.1s;
stroke-width: 3px;
fill: transparent;

.input:not(:checked) + .x-privacy-manager-label:hover & {
.x-privacy-manager-radio-button__input:not(:checked) + .x-privacy-manager-label:hover & {
stroke: oColorsByName('teal-40');
}
}
Expand All @@ -97,11 +97,11 @@ $transitionDuration: 0.1s;

fill: transparent;

.input:not(:checked) + .x-privacy-manager-label:hover & {
.x-privacy-manager-radio-button__input:not(:checked) + .x-privacy-manager-label:hover & {
fill: oColorsByName('teal-40');
}

.input:checked + .x-privacy-manager-label & {
.x-privacy-manager-radio-button__input:checked + .x-privacy-manager-label & {
fill: currentColor;
}
}
2 changes: 2 additions & 0 deletions components/x-privacy-manager/src/privacy-manager.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { RadioBtn } from './components/radio-btn'
import { withCustomActions } from './actions'
import * as utils from './utils'

import './privacy-manager.scss'

const defaultButtonText = {
allow: { label: 'Allow', text: 'See personalised adverts' },
block: { label: 'Block', text: 'Opt out of personalised adverts' },
Expand Down
2 changes: 0 additions & 2 deletions components/x-privacy-manager/src/privacy-manager.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
@import '@financial-times/o-spacing/main';
@import '@financial-times/o-typography/main';

@import './components/radio-btn';

%vertical-middle {
display: inline-block;
vertical-align: middle;
Expand Down
2 changes: 0 additions & 2 deletions components/x-privacy-manager/storybook/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import '../src/privacy-manager.scss'

export { LegislationCCPA } from './stories/legislation-ccpa'
export { LegislationGDPR } from './stories/legislation-gdpr'

Expand Down

0 comments on commit 18b3614

Please sign in to comment.