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

Replace TailwindCSS with Protocol and SCSS for styling #312

Merged
merged 11 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from 8 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
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
public/build/bundle.js
scripts/build-glean-metadata.js
src/ga.js
src/Tailwindcss.svelte
storybook-static/*
venv/*
4 changes: 3 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@ module.exports = {
"import/no-duplicates": "off",
"import/no-mutable-exports": "off",
"import/no-unresolved": "off",

// Temporarily work around a bug in eslint-plugin-svelte3.
//
// https://github.com/sveltejs/eslint-plugin-svelte3/issues/41#issuecomment-572503966
"no-multiple-empty-lines": ["error", { max: 2, maxBOF: 2, maxEOF: 0 }],
},
settings: {
"svelte3/ignore-styles": () => true,
Iinh marked this conversation as resolved.
Show resolved Hide resolved
},
},
{
files: ["tests/**/*.test.js"],
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ public/data/*
storybook-static/*
venv
src/ga.js
src/scss/
Iinh marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 19 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const sveltePreprocess = require("svelte-preprocess");
const autoPrefixer = require("autoprefixer");

module.exports = {
stories: ["../stories/**/*.stories.js"],
Expand All @@ -10,9 +11,26 @@ module.exports = {
);
svelteLoader.options = {
...svelteLoader.options,
preprocess: sveltePreprocess({ postcss: true }),
preprocess: sveltePreprocess({
postcss: true,
defaults: {
style: "scss",
},
scss: {
prependData: `@import 'node_modules/@mozilla-protocol/core/protocol/css/protocol.scss';`,
},
postcss: {
plugins: [autoPrefixer],
},
}),
};

config.module.rules.push({
// this is for both less and scss
test: /.*\.(?:le|c|sc)ss$/,
loaders: ["style-loader", "css-loader", "sass-loader"],
});

return config;
},
};
2 changes: 1 addition & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "./story.css";
import "!style-loader!css-loader!sass-loader!../node_modules/@mozilla-protocol/core/protocol/css/protocol.scss";
Iinh marked this conversation as resolved.
Show resolved Hide resolved
1 change: 0 additions & 1 deletion .storybook/story.css
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
@import "../src/main.css";
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module.exports = {
moduleNameMapper: {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js",
"\\.(css|less|scss)$": "<rootDir>/__mocks__/styleMock.js",
},
};
Loading